~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: David Shrewsbury
  • Date: 2010-10-10 22:32:43 UTC
  • mto: (1838.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1839.
  • Revision ID: shrewsbury.dave@gmail.com-20101010223243-9i0xvh0da7fbna7e
Add server startup and shutdown events to the replication stream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
#include "drizzled/tztime.h"
60
60
#include "drizzled/signal_handler.h"
61
61
#include "drizzled/replication_services.h"
 
62
#include "drizzled/transaction_services.h"
62
63
 
63
64
using namespace drizzled;
64
65
using namespace std;
328
329
                PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
329
330
 
330
331
 
 
332
  TransactionServices &transaction_services= TransactionServices::singleton();
 
333
 
 
334
  /* Send server startup event */
 
335
  if ((session= new Session(plugin::Listen::getNullClient())))
 
336
  {
 
337
    transaction_services.sendStartupEvent(session);
 
338
    session->lockForDelete();
 
339
    delete session;
 
340
  }
 
341
 
 
342
 
331
343
  /* Listen for new connections and start new session for each connection
332
344
     accepted. The listen.getClient() method will return NULL when the server
333
345
     should be shutdown. */
344
356
      Session::unlink(session);
345
357
  }
346
358
 
 
359
  /* Send server shutdown event */
 
360
  if ((session= new Session(plugin::Listen::getNullClient())))
 
361
  {
 
362
    transaction_services.sendShutdownEvent(session);
 
363
    session->lockForDelete();
 
364
    delete session;
 
365
  }
 
366
 
347
367
  LOCK_thread_count.lock();
348
368
  select_thread_in_use=0;                       // For close_connections
349
369
  LOCK_thread_count.unlock();