~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/signal_handler.cc

  • Committer: Joseph Daly
  • Date: 2010-10-24 03:19:07 UTC
  • mto: (1856.2.16 transaction_id_innodb)
  • mto: This revision was merged to the branch mainline in revision 1900.
  • Revision ID: skinny.moey@gmail.com-20101024031907-cnkdjmjycx62jsv0
create schema changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
22
#include <signal.h>
23
23
 
24
 
#include <drizzled/signal_handler.h>
25
 
#include <drizzled/drizzled.h>
26
 
#include <drizzled/session.h>
27
 
#include <drizzled/session/cache.h>
28
 
#include <drizzled/internal/my_sys.h>
29
 
#include <drizzled/probes.h>
30
 
#include <drizzled/plugin.h>
31
 
#include <drizzled/plugin/scheduler.h>
32
 
#include <drizzled/current_session.h>
 
24
#include "drizzled/signal_handler.h"
 
25
#include "drizzled/drizzled.h"
 
26
#include "drizzled/session.h"
 
27
#include "drizzled/internal/my_sys.h"
 
28
#include "drizzled/probes.h"
 
29
#include "drizzled/plugin.h"
 
30
#include "drizzled/plugin/scheduler.h"
33
31
 
34
 
#include <drizzled/util/backtrace.h>
 
32
#include "drizzled/util/backtrace.h"
35
33
 
36
34
using namespace drizzled;
37
35
 
50
48
void drizzled_print_signal_warning(int sig)
51
49
{
52
50
  if (global_system_variables.log_warnings)
53
 
    errmsg_printf(error::WARN, _("Got signal %d from thread %"PRIu32),
 
51
    errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
54
52
                  sig, global_thread_id);
55
53
#ifndef HAVE_BSD_SIGNALS
56
54
  sigset_t set;
69
67
/** Called when a thread is aborted. */
70
68
void drizzled_end_thread_signal(int )
71
69
{
72
 
  Session *session= current_session;
 
70
  Session *session=current_session;
73
71
  if (session)
74
72
  {
75
 
    Session::shared_ptr session_ptr(session::Cache::singleton().find(session->getSessionId()));
76
 
    if (not session_ptr) // We need to make we have a lock on session before we do anything with it.
77
 
      return;
78
 
 
79
73
    killed_threads++;
80
 
 
81
 
    // We need to get the ID before we kill off the session
82
 
    session_ptr->scheduler->killSessionNow(session_ptr);
83
 
    DRIZZLE_CONNECTION_DONE(session_ptr->getSessionId());
 
74
    session->scheduler->killSessionNow(session);
 
75
    DRIZZLE_CONNECTION_DONE(session->thread_id);
84
76
  }
 
77
  return;
85
78
}
86
79
 
87
80
static void write_core(int sig)