diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-12-19 11:27:22 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-12-19 11:27:22 +0300 |
commit | faed50d5552f6d78f4c32274b346516f4267304b (patch) | |
tree | 3b5c7e394cefb5bd79d4936b079c252c054b3a8c /include/my_pthread.h | |
parent | 2e72189535e3be76c82c58aa2164990674b08216 (diff) | |
parent | 45222a117dcc9f358bf217646f292a8cae5b9ad0 (diff) | |
download | mariadb-git-faed50d5552f6d78f4c32274b346516f4267304b.tar.gz |
Auto-merge from mysql-next-mr.
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 0b59aad56f9..2558f8d5986 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -67,6 +67,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 @@ -110,6 +115,7 @@ int pthread_cond_destroy(pthread_cond_t *cond); int pthread_attr_init(pthread_attr_t *connect_att); int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack); 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); @@ -184,6 +190,10 @@ void my_pthread_exit(void *status); #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) |