~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/signal_handler/signal_handler.cc

  • Committer: LinuxJedi
  • Date: 2010-08-28 09:23:52 UTC
  • mto: (1738.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1739.
  • Revision ID: linuxjedi@linuxjedi-laptop-20100828092352-oe3zbtdy05kq9dtq
Make exit happen in main thread rather than signal handler thread thus avoiding a segfault due to a double kill of the signal handler thread

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "drizzled/plugin/daemon.h"
26
26
#include "drizzled/signal_handler.h"
27
27
 
 
28
#include "drizzled/drizzled.h"
 
29
 
28
30
#include <sys/stat.h>
29
31
#include <fcntl.h>
30
32
 
31
33
 
32
34
static bool kill_in_progress= false;
33
 
static bool volatile signal_thread_in_use= false;
 
35
//static bool volatile signal_thread_in_use= false;
34
36
extern "C" pthread_handler_t signal_hand(void *);
35
37
 
36
38
namespace drizzled
73
75
    errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_NORMAL_SHUTDOWN)),internal::my_progname);
74
76
  else
75
77
    errmsg_printf(ERRMSG_LVL_ERROR, _(ER(ER_GOT_SIGNAL)),internal::my_progname,sig);
76
 
 
 
78
  ready_to_exit= true;
77
79
  close_connections();
78
 
  if (sig != SIGTERM && sig != 0)
79
 
    unireg_abort(1);
80
 
  else
81
 
    unireg_end();
82
80
}
83
81
 
84
82
/**