~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_pthread.h

  • Committer: Monty Taylor
  • Date: 2008-10-23 23:53:49 UTC
  • mto: This revision was merged to the branch mainline in revision 557.
  • Revision ID: monty@inaugust.com-20081023235349-317wgwqwgccuacmq
SplitĀ outĀ nested_join.h.

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 <unistd.h>
 
23
 
21
24
#ifndef ETIME
22
25
#define ETIME ETIMEDOUT                         /* For FreeBSD */
23
26
#endif
41
44
#endif
42
45
 
43
46
#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
47
#define pthread_detach_this_thread()
47
48
#define pthread_handler_t EXTERNC void *
48
49
typedef void *(* pthread_handler)(void *);
105
106
#define my_sigset(A,B) signal((A),(B))
106
107
#endif
107
108
 
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
109
#ifndef my_pthread_attr_setprio
119
110
#ifdef HAVE_PTHREAD_ATTR_SETPRIO
120
111
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
262
253
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
263
254
                        struct timespec *abstime, const char *file, uint32_t line);
264
255
void safe_mutex_global_init(void);
265
 
void safe_mutex_end(FILE *file);
 
256
void safe_mutex_end(void);
266
257
 
267
258
        /* Wrappers if safe mutex is actually used */
268
259
#define safe_mutex_assert_owner(mp)
386
377
#define ESRCH 1
387
378
#endif
388
379
 
389
 
typedef ulong my_thread_id;
 
380
typedef uint64_t my_thread_id;
390
381
 
391
382
extern bool my_thread_global_init(void);
392
383
extern void my_thread_global_end(void);
398
389
/* All thread specific variables are in the following struct */
399
390
 
400
391
#define THREAD_NAME_SIZE 10
401
 
#ifndef DEFAULT_THREAD_STACK
402
 
#if SIZEOF_CHARP > 4
403
392
/*
404
 
  MySQL can survive with 32K, but some glibc libraries require > 128K stack
405
 
  To resolve hostnames. Also recursive stored procedures needs stack.
 
393
  Drizzle can survive with 32K, but some glibc libraries require > 128K stack
 
394
  to resolve hostnames. Also recursive stored procedures needs stack.
406
395
*/
407
 
#define DEFAULT_THREAD_STACK    (256*1024L)
408
 
#else
409
 
#define DEFAULT_THREAD_STACK    (192*1024)
410
 
#endif
411
 
#endif
 
396
#define DEFAULT_THREAD_STACK    (256*INT32_C(1024))
412
397
 
413
398
struct st_my_thread_var
414
399
{