~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_thr_init.cc

  • Committer: Brian Aker
  • Date: 2009-02-09 16:44:46 UTC
  • Revision ID: brian@tangent.org-20090209164446-6waq1s20v7zw92rs
Remove USE_TLS (dead define)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
uint32_t thd_lib_detected= 0;
40
40
 
41
 
#ifdef USE_TLS
42
 
pthread_key_t THR_KEY_mysys;
43
 
#else
44
 
pthread_key_t THR_KEY_mysys;
45
 
#endif /* USE_TLS */
 
41
pthread_key_t THR_KEY_mysys;
46
42
pthread_mutex_t THR_LOCK_open;
47
43
pthread_mutex_t THR_LOCK_lock;
48
44
pthread_mutex_t THR_LOCK_charset;
273
269
    pthread_cond_destroy(&tmp->suspend);
274
270
#endif
275
271
    pthread_mutex_destroy(&tmp->mutex);
276
 
#if defined(USE_TLS)
277
 
    free(tmp);
278
 
#else
279
272
    tmp->init= 0;
280
 
#endif
281
273
 
282
274
    /*
283
275
      Decrement counter for number of running threads. We are using this
291
283
      pthread_cond_signal(&THR_COND_threads);
292
284
   pthread_mutex_unlock(&THR_LOCK_threads);
293
285
  }
294
 
  /* The following free has to be done, even if my_thread_var() is 0 */
295
 
#if defined(USE_TLS)
296
 
  pthread_setspecific(THR_KEY_mysys,0);
297
 
#endif
298
286
}
299
287
 
300
288
struct st_my_thread_var *_my_thread_var(void)
301
289
{
302
290
  struct st_my_thread_var *tmp= (struct st_my_thread_var*)pthread_getspecific(THR_KEY_mysys);
303
 
#if defined(USE_TLS)
304
 
  /* This can only happen in a .DLL */
305
 
  if (!tmp)
306
 
  {
307
 
    my_thread_init();
308
 
    tmp=(struct st_my_thread_var*)pthread_getspecific(THR_KEY_mysys);
309
 
  }
310
 
#endif
311
291
  return tmp;
312
292
}
313
293