~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_thr_init.cc

  • Committer: Brian Aker
  • Date: 2010-08-19 16:45:03 UTC
  • mfrom: (1711.6.11 staging)
  • Revision ID: brian@tangent.org-20100819164503-t7rhibp5s7bv3dtu
Merge of signals, plus build fix for FreeBSD. Also contains memset/constructor patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
namespace internal
45
45
{
46
46
 
47
 
uint32_t thd_lib_detected= 0;
48
 
 
49
47
pthread_key_t THR_KEY_mysys;
50
48
pthread_mutex_t THR_LOCK_lock;
51
49
pthread_mutex_t THR_LOCK_threads;
56
54
pthread_mutexattr_t my_fast_mutexattr;
57
55
#endif
58
56
 
59
 
static uint32_t get_thread_lib(void);
60
 
 
61
57
/*
62
58
  initialize thread environment
63
59
 
72
68
bool my_thread_global_init(void)
73
69
{
74
70
  int pth_ret;
75
 
  thd_lib_detected= get_thread_lib();
76
71
 
77
72
  if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0)
78
73
  {
250
245
  return tmp;
251
246
}
252
247
 
253
 
static uint32_t get_thread_lib(void)
254
 
{
255
 
#ifdef _CS_GNU_LIBPTHREAD_VERSION
256
 
  char buff[64];
257
 
 
258
 
  confstr(_CS_GNU_LIBPTHREAD_VERSION, buff, sizeof(buff));
259
 
 
260
 
  if (!strncasecmp(buff, "NPTL", 4))
261
 
    return THD_LIB_NPTL;
262
 
  if (!strncasecmp(buff, "linuxthreads", 12))
263
 
    return THD_LIB_LT;
264
 
#endif
265
 
  return THD_LIB_OTHER;
266
 
}
267
 
 
268
248
} /* namespace internal */
269
249
} /* namespace drizzled */