~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_pthread.h

  • Committer: mordred
  • Date: 2008-11-01 00:46:20 UTC
  • mto: (572.1.1 devel) (575.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: mordred@opensolaris-20081101004620-vd0kzsl9k40hvf4p
Some updates to dtrace support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef _my_pthread_h
19
19
#define _my_pthread_h
20
20
 
 
21
#include <stdint.h>
 
22
#include <stdbool.h>
 
23
#include <unistd.h>
 
24
 
21
25
#ifndef ETIME
22
26
#define ETIME ETIMEDOUT                         /* For FreeBSD */
23
27
#endif
41
45
#endif
42
46
 
43
47
#define pthread_key(T,V) pthread_key_t V
44
 
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
45
 
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
46
48
#define pthread_detach_this_thread()
47
49
#define pthread_handler_t EXTERNC void *
48
50
typedef void *(* pthread_handler)(void *);
105
107
#define my_sigset(A,B) signal((A),(B))
106
108
#endif
107
109
 
108
 
#ifndef my_pthread_setprio
109
 
#if defined(HAVE_PTHREAD_SETPRIO_NP)            /* FSU threads */
110
 
#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
111
 
#elif defined(HAVE_PTHREAD_SETPRIO)
112
 
#define my_pthread_setprio(A,B) pthread_setprio((A),(B))
113
 
#else
114
 
extern void my_pthread_setprio(pthread_t thread_id,int prior);
115
 
#endif
116
 
#endif
117
 
 
118
110
#ifndef my_pthread_attr_setprio
119
111
#ifdef HAVE_PTHREAD_ATTR_SETPRIO
120
112
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
262
254
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
263
255
                        struct timespec *abstime, const char *file, uint32_t line);
264
256
void safe_mutex_global_init(void);
265
 
void safe_mutex_end(FILE *file);
 
257
void safe_mutex_end(void);
266
258
 
267
259
        /* Wrappers if safe mutex is actually used */
268
260
#define safe_mutex_assert_owner(mp)
386
378
#define ESRCH 1
387
379
#endif
388
380
 
389
 
typedef ulong my_thread_id;
 
381
typedef uint64_t my_thread_id;
390
382
 
391
383
extern bool my_thread_global_init(void);
392
384
extern void my_thread_global_end(void);
398
390
/* All thread specific variables are in the following struct */
399
391
 
400
392
#define THREAD_NAME_SIZE 10
401
 
#ifndef DEFAULT_THREAD_STACK
402
 
#if SIZEOF_CHARP > 4
403
393
/*
404
 
  MySQL can survive with 32K, but some glibc libraries require > 128K stack
405
 
  To resolve hostnames. Also recursive stored procedures needs stack.
 
394
  Drizzle can survive with 32K, but some glibc libraries require > 128K stack
 
395
  to resolve hostnames. Also recursive stored procedures needs stack.
406
396
*/
407
 
#define DEFAULT_THREAD_STACK    (256*1024L)
408
 
#else
409
 
#define DEFAULT_THREAD_STACK    (192*1024)
410
 
#endif
411
 
#endif
 
397
#define DEFAULT_THREAD_STACK    (256*INT32_C(1024))
412
398
 
413
399
struct st_my_thread_var
414
400
{