~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/signal_handler/signal_handler.cc

  • Committer: Andrew Hutchings
  • Date: 2010-11-09 13:38:01 UTC
  • mto: (1919.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1920.
  • Revision ID: andrew@linuxjedi.co.uk-20101109133801-byjzsao76346395x
Add FLUSH GLOBAL STATUS; command
Clears the global status variables for the server

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/session/cache.h"
29
 
 
30
28
#include "drizzled/drizzled.h"
31
29
 
32
30
#include <boost/thread/thread.hpp>
54
52
 
55
53
 
56
54
 
57
 
 
58
55
/**
59
56
  Force server down. Kill all connections and threads and exit.
60
57
 
161
158
    (Asked MontyW over the phone about this.) -Brian
162
159
 
163
160
  */
164
 
  session::Cache::singleton().mutex().lock();
165
 
  session::Cache::singleton().mutex().unlock();
 
161
  LOCK_thread_count.lock();
 
162
  LOCK_thread_count.unlock();
166
163
  COND_thread_count.notify_all();
167
164
 
168
165
  if (pthread_sigmask(SIG_BLOCK, &set, NULL))
227
224
    drizzled::plugin::Daemon("Signal Handler")
228
225
  {
229
226
    // @todo fix spurious wakeup issue
230
 
    boost::mutex::scoped_lock scopedLock(session::Cache::singleton().mutex());
 
227
    boost::mutex::scoped_lock scopedLock(LOCK_thread_count);
231
228
    thread= boost::thread(signal_hand);
232
229
    signal_thread= thread.native_handle();
233
230
    COND_thread_count.wait(scopedLock);