~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_thr_init.c

Renamed strings to mystrings, for include/lib naming consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
*/
20
20
 
21
21
#include "mysys_priv.h"
22
 
#include <mystrings/m_string.h>
 
22
#include <m_string.h>
23
23
#include <signal.h>
24
24
 
25
 
#if TIME_WITH_SYS_TIME
26
 
# include <sys/time.h>
27
 
# include <time.h>
28
 
#else
29
 
# if HAVE_SYS_TIME_H
30
 
#  include <sys/time.h>
31
 
# else
32
 
#  include <time.h>
33
 
# endif
34
 
#endif  
35
 
 
36
 
uint32_t thd_lib_detected= 0;
 
25
uint thd_lib_detected= 0;
37
26
 
38
27
#ifdef USE_TLS
39
 
pthread_key_t THR_KEY_mysys;
 
28
pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
40
29
#else
41
 
pthread_key_t THR_KEY_mysys;
 
30
pthread_key(struct st_my_thread_var, THR_KEY_mysys);
42
31
#endif /* USE_TLS */
43
32
pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open,
44
33
                THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_myisam,THR_LOCK_heap,
45
34
                THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time;
46
35
pthread_cond_t  THR_COND_threads;
47
 
uint32_t            THR_thread_count= 0;
48
 
uint32_t                my_thread_end_wait_time= 5;
 
36
uint            THR_thread_count= 0;
 
37
uint            my_thread_end_wait_time= 5;
49
38
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
50
39
pthread_mutex_t LOCK_localtime_r;
51
40
#endif
77
66
#endif /* TARGET_OS_LINUX */
78
67
 
79
68
 
80
 
static uint32_t get_thread_lib(void);
 
69
static uint get_thread_lib(void);
81
70
 
82
71
/*
83
72
  initialize thread environment
261
250
 
262
251
#ifdef EXTRA_DEBUG_THREADS
263
252
  fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n",
264
 
          (uint32_t) pthread_self());
 
253
          (ulong) pthread_self());
265
254
#endif  
266
255
 
267
256
  if (pthread_getspecific(THR_KEY_mysys))
353
342
  if (!tmp)
354
343
  {
355
344
    my_thread_init();
356
 
    tmp=(struct st_my_thread_var*)pthread_getspecific(THR_KEY_mysys);
 
345
    tmp=my_pthread_getspecific(struct st_my_thread_var*,THR_KEY_mysys);
357
346
  }
358
347
#endif
359
348
  return tmp;
369
358
  return my_thread_var->id;
370
359
}
371
360
 
372
 
static uint32_t get_thread_lib(void)
 
361
static uint get_thread_lib(void)
373
362
{
374
363
#ifdef _CS_GNU_LIBPTHREAD_VERSION
375
364
  char buff[64];