~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/signal_handler.cc

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

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
24
24
#include "drizzled/signal_handler.h"
25
25
#include "drizzled/drizzled.h"
26
26
#include "drizzled/session.h"
27
 
#include "drizzled/session/cache.h"
28
27
#include "drizzled/internal/my_sys.h"
29
28
#include "drizzled/probes.h"
30
29
#include "drizzled/plugin.h"
49
48
void drizzled_print_signal_warning(int sig)
50
49
{
51
50
  if (global_system_variables.log_warnings)
52
 
    errmsg_printf(error::WARN, _("Got signal %d from thread %"PRIu32),
 
51
    errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
53
52
                  sig, global_thread_id);
54
53
#ifndef HAVE_BSD_SIGNALS
55
54
  sigset_t set;
68
67
/** Called when a thread is aborted. */
69
68
void drizzled_end_thread_signal(int )
70
69
{
71
 
  Session *session= current_session;
 
70
  Session *session=current_session;
72
71
  if (session)
73
72
  {
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
 
 
78
73
    killed_threads++;
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());
 
74
    session->scheduler->killSessionNow(session);
 
75
    DRIZZLE_CONNECTION_DONE(session->thread_id);
83
76
  }
 
77
  return;
84
78
}
85
79
 
86
80
static void write_core(int sig)