~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_thr_init.c

  • Committer: Monty Taylor
  • Date: 2008-07-22 05:48:51 UTC
  • mto: (202.1.3 toru)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: monty@inaugust.com-20080722054851-airxt73370725p7x
Re-enabled optimizations for the normal build, and added back the --with-debug option to turn them off. 

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
28
pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
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
249
238
    case the checking of mutex_locks will not work until
250
239
    the pthread_self thread specific variable is initialized.
251
240
 
 
241
   This function may called multiple times for a thread, for example
 
242
   if one uses my_init() followed by mysql_server_init().
 
243
 
252
244
  RETURN
253
245
    0  ok
254
246
    1  Fatal error; mysys/dbug functions can't be used
261
253
 
262
254
#ifdef EXTRA_DEBUG_THREADS
263
255
  fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n",
264
 
          (uint32_t) pthread_self());
 
256
          (ulong) pthread_self());
265
257
#endif  
266
258
 
267
259
  if (pthread_getspecific(THR_KEY_mysys))
369
361
  return my_thread_var->id;
370
362
}
371
363
 
372
 
static uint32_t get_thread_lib(void)
 
364
static uint get_thread_lib(void)
373
365
{
374
366
#ifdef _CS_GNU_LIBPTHREAD_VERSION
375
367
  char buff[64];