1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#ifndef PTHREAD_COMPAT_
#define PTHREAD_COMPAT_
#if defined(WITH_THREADING) && !defined(WITH_BROKER)
# include <pthread.h>
# define COMPAT_pthread_create(A, B, C, D) pthread_create((A), (B), (C), (D))
# define COMPAT_pthread_join(A, B) pthread_join((A), (B))
# define COMPAT_pthread_cancel(A) pthread_cancel((A))
# define COMPAT_pthread_testcancel() pthread_testcancel()
# define COMPAT_pthread_mutex_init(A, B) pthread_mutex_init((A), (B))
# define COMPAT_pthread_mutex_destroy(A) pthread_mutex_destroy((A))
# define COMPAT_pthread_mutex_lock(A) pthread_mutex_lock((A))
# define COMPAT_pthread_mutex_unlock(A) pthread_mutex_unlock((A))
#else
# define COMPAT_pthread_create(A, B, C, D)
# define COMPAT_pthread_join(A, B)
# define COMPAT_pthread_cancel(A)
# define COMPAT_pthread_testcancel()
# define COMPAT_pthread_mutex_init(A, B)
# define COMPAT_pthread_mutex_destroy(A)
# define COMPAT_pthread_mutex_lock(A)
# define COMPAT_pthread_mutex_unlock(A)
#endif
#endif
|