~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/signal_handler.cc

  • Committer: Lee Bieber
  • Date: 2010-11-18 15:33:33 UTC
  • mfrom: (1932.3.14 trunk)
  • Revision ID: kalebral@gmail.com-20101118153333-1onwy3lvwmxltqdn
Merge Brian - more session work and clean up

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "drizzled/signal_handler.h"
25
25
#include "drizzled/drizzled.h"
26
26
#include "drizzled/session.h"
 
27
#include "drizzled/session_list.h"
27
28
#include "drizzled/internal/my_sys.h"
28
29
#include "drizzled/probes.h"
29
30
#include "drizzled/plugin.h"
67
68
/** Called when a thread is aborted. */
68
69
void drizzled_end_thread_signal(int )
69
70
{
70
 
  Session *session=current_session;
 
71
  Session *session= current_session;
71
72
  if (session)
72
73
  {
 
74
    Session::shared_ptr session_ptr(session::Cache::singleton().find(session->getSessionId()));
 
75
    if (not session_ptr) // We need to make we have a lock on session before we do anything with it.
 
76
      return;
 
77
 
73
78
    killed_threads++;
74
 
    session->scheduler->killSessionNow(session);
75
 
    DRIZZLE_CONNECTION_DONE(session->thread_id);
 
79
 
 
80
    // We need to get the ID before we kill off the session
 
81
    session_ptr->scheduler->killSessionNow(session_ptr);
 
82
    DRIZZLE_CONNECTION_DONE(session_ptr->getSessionId());
76
83
  }
77
 
  return;
78
84
}
79
85
 
80
86
static void write_core(int sig)