diff options
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r-- | include/my_pthread.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index 3d011f61ca2..652bdd205c0 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -499,11 +499,26 @@ extern int my_rw_unlock( my_rw_lock_t * ); #define pthread_attr_setstacksize(A,B) pthread_dummy(0) #endif +/* Define mutex types */ +#define MY_MUTEX_INIT_SLOW NULL +#define MY_MUTEX_INIT_FAST NULL +#define MY_MUTEX_INIT_ERRCHK NULL +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +extern pthread_mutexattr_t my_fast_mutexattr; +#undef MY_MUTEX_INIT_FAST +#define MY_MUTEX_INIT_FAST &my_fast_mutexattr +#endif +#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP +extern pthread_mutexattr_t my_errchk_mutexattr; +#undef MY_INIT_MUTEX_ERRCHK +#define MY_INIT_MUTEX_ERRCHK &my_errchk_mutexattr +#endif + extern my_bool my_thread_global_init(void); extern void my_thread_global_end(void); extern my_bool my_thread_init(void); extern void my_thread_end(void); -extern char *my_thread_name(void); +extern const char *my_thread_name(void); extern long my_thread_id(void); extern int pthread_no_free(void *); extern int pthread_dummy(int); |