~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: Brian Aker
  • Date: 2010-08-07 22:00:10 UTC
  • mfrom: (1689.1.6 drizzle)
  • Revision ID: brian@gaz-20100807220010-ozs2dcmjgmvaq7i2
Rollup of boost mutex, plus fix for unlock().

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
      Session::unlink(session);
325
325
  }
326
326
 
327
 
  /* (void) pthread_attr_destroy(&connection_attrib); */
328
 
 
329
 
 
330
 
  (void) pthread_mutex_lock(&LOCK_thread_count);
 
327
  LOCK_thread_count.lock();
331
328
  select_thread_in_use=0;                       // For close_connections
332
 
  (void) pthread_mutex_unlock(&LOCK_thread_count);
333
 
  (void) pthread_cond_broadcast(&COND_thread_count);
 
329
  LOCK_thread_count.unlock();
 
330
  COND_thread_count.notify_all();
334
331
 
335
332
  /* Wait until cleanup is done */
336
 
  (void) pthread_mutex_lock(&LOCK_thread_count);
 
333
  LOCK_thread_count.lock();
337
334
  while (!ready_to_exit)
338
 
    pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
339
 
  (void) pthread_mutex_unlock(&LOCK_thread_count);
 
335
    pthread_cond_wait(COND_server_end.native_handle(), LOCK_thread_count.native_handle());
 
336
  LOCK_thread_count.unlock();
340
337
 
341
338
  clean_up(1);
342
339
  module::Registry::shutdown();
343
 
  clean_up_mutexes();
344
340
  internal::my_end();
345
341
  return 0;
346
342
}