diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-16 16:47:07 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-16 16:47:07 +0300 |
commit | efe619585840b27ef156b35f2be6ef3c9809d2e5 (patch) | |
tree | fa68ffcd1dbdaf248e483a5692358fe7330ec507 /include/my_pthread.h | |
parent | a1218bb782f646111c9302740b4c443e3fed6d88 (diff) | |
parent | 8f32ccff6032e03782ad805b97328f2e5e047384 (diff) | |
download | mariadb-git-efe619585840b27ef156b35f2be6ef3c9809d2e5.tar.gz |
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r-- | include/my_pthread.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index b6d9feae067..9e0be6b779e 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -68,6 +68,11 @@ typedef int pthread_mutexattr_t; #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); +typedef volatile LONG my_pthread_once_t; +#define MY_PTHREAD_ONCE_INIT 0 +#define MY_PTHREAD_ONCE_INPROGRESS 1 +#define MY_PTHREAD_ONCE_DONE 2 + /* Struct and macros to be used in combination with the windows implementation of pthread_cond_timedwait @@ -112,6 +117,7 @@ int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); int pthread_attr_setprio(pthread_attr_t *connect_att,int priority); int pthread_attr_destroy(pthread_attr_t *connect_att); +int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); struct tm *localtime_r(const time_t *timep,struct tm *tmp); struct tm *gmtime_r(const time_t *timep,struct tm *tmp); @@ -190,6 +196,10 @@ extern int my_pthread_getprio(pthread_t thread_id); #define pthread_handler_t EXTERNC void * typedef void *(* pthread_handler)(void *); +#define my_pthread_once_t pthread_once_t +#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT +#define my_pthread_once(C,F) pthread_once(C,F) + /* Test first for RTS or FSU threads */ #if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) |