~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-04-09 18:05:30 UTC
  • mfrom: (971.3.23 eday-dev)
  • Revision ID: brian@gaz-20090409180530-2572kyiqft7hst0a
MergeĀ Eric

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
pthread_rwlock_t        LOCK_system_variables_hash;
391
391
pthread_cond_t COND_refresh, COND_thread_count, COND_global_read_lock;
392
392
pthread_t signal_thread;
393
 
pthread_cond_t  COND_server_started;
 
393
pthread_cond_t  COND_server_end;
394
394
 
395
395
/* replication parameters, if master_host is not NULL, we are a slave */
396
396
uint32_t report_port= DRIZZLE_PORT;
527
527
      break;
528
528
    }
529
529
    (void) pthread_mutex_unlock(&LOCK_thread_count);
530
 
    unlink_session(tmp);
 
530
    tmp->protocol->forceClose();
531
531
  }
532
 
  assert(session_list.is_empty());
533
532
}
534
533
 
535
534
 
616
615
  (void) pthread_mutex_lock(&LOCK_thread_count);
617
616
  ready_to_exit=1;
618
617
  /* do the broadcast inside the lock to ensure that my_end() is not called */
619
 
  (void) pthread_cond_broadcast(&COND_thread_count);
 
618
  (void) pthread_cond_broadcast(&COND_server_end);
620
619
  (void) pthread_mutex_unlock(&LOCK_thread_count);
621
620
 
622
621
  /*
637
636
  (void) pthread_rwlock_destroy(&LOCK_system_variables_hash);
638
637
  (void) pthread_mutex_destroy(&LOCK_global_read_lock);
639
638
  (void) pthread_cond_destroy(&COND_thread_count);
 
639
  (void) pthread_cond_destroy(&COND_server_end);
640
640
  (void) pthread_cond_destroy(&COND_refresh);
641
641
  (void) pthread_cond_destroy(&COND_global_read_lock);
642
642
}
1507
1507
  (void) pthread_rwlock_init(&LOCK_system_variables_hash, NULL);
1508
1508
  (void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST);
1509
1509
  (void) pthread_cond_init(&COND_thread_count,NULL);
 
1510
  (void) pthread_cond_init(&COND_server_end,NULL);
1510
1511
  (void) pthread_cond_init(&COND_refresh,NULL);
1511
1512
  (void) pthread_cond_init(&COND_global_read_lock,NULL);
1512
1513
 
1796
1797
  /* Wait until cleanup is done */
1797
1798
  (void) pthread_mutex_lock(&LOCK_thread_count);
1798
1799
  while (!ready_to_exit)
1799
 
    pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
 
1800
    pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
1800
1801
  (void) pthread_mutex_unlock(&LOCK_thread_count);
1801
1802
 
1802
1803
  clean_up(1);