~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_thr_init.cc

  • Committer: Brian Aker
  • Date: 2008-11-22 03:09:08 UTC
  • Revision ID: brian@tangent.org-20081122030908-lxa932c5r94ed671
Second pass on dead mutex

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
pthread_cond_t  THR_COND_threads;
52
52
uint32_t            THR_thread_count= 0;
53
53
uint32_t                my_thread_end_wait_time= 5;
54
 
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
55
 
pthread_mutex_t LOCK_localtime_r;
56
 
#endif
57
 
#ifndef HAVE_GETHOSTBYNAME_R
58
 
pthread_mutex_t LOCK_gethostbyname_r;
59
 
#endif
60
54
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
61
55
pthread_mutexattr_t my_fast_mutexattr;
62
56
#endif
137
131
  pthread_mutex_init(&THR_LOCK_threads,MY_MUTEX_INIT_FAST);
138
132
  pthread_mutex_init(&THR_LOCK_time,MY_MUTEX_INIT_FAST);
139
133
  pthread_cond_init(&THR_COND_threads, NULL);
140
 
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
141
 
  pthread_mutex_init(&LOCK_localtime_r,MY_MUTEX_INIT_SLOW);
142
 
#endif
143
 
#ifndef HAVE_GETHOSTBYNAME_R
144
 
  pthread_mutex_init(&LOCK_gethostbyname_r,MY_MUTEX_INIT_SLOW);
145
 
#endif
146
134
  if (my_thread_init())
147
135
  {
148
136
    my_thread_global_end();                     /* Clean up */
199
187
    pthread_mutex_destroy(&THR_LOCK_threads);
200
188
    pthread_cond_destroy(&THR_COND_threads);
201
189
  }
202
 
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
203
 
  pthread_mutex_destroy(&LOCK_localtime_r);
204
 
#endif
205
 
#ifndef HAVE_GETHOSTBYNAME_R
206
 
  pthread_mutex_destroy(&LOCK_gethostbyname_r);
207
 
#endif
208
190
}
209
191
 
210
192
static my_thread_id thread_id= 0;