39 #ifndef BLOCXX_THREAD_TYPES_HPP_
40 #define BLOCXX_THREAD_TYPES_HPP_
41 #include "blocxx/BLOCXX_config.h"
46 #if defined(BLOCXX_USE_PTHREAD)
50 #ifdef BLOCXX_NCR //for the function pthread_cond_init
51 #define PTHREAD_COND_ATTR_DEFAULT pthread_condattr_default
53 #define PTHREAD_COND_ATTR_DEFAULT 0
56 namespace BLOCXX_NAMESPACE
60 typedef pthread_t Thread_t;
61 typedef pthread_mutex_t NativeMutex_t;
62 struct NonRecursiveMutex_t
64 pthread_mutex_t mutex;
67 #if defined(BLOCXX_HAVE_PTHREAD_MUTEXATTR_SETTYPE)
72 pthread_mutex_t mutex;
80 pthread_mutex_t mutex;
81 pthread_cond_t unlocked;
89 typedef pthread_cond_t ConditionVar_t;
90 struct NonRecursiveMutexLockState
93 NativeMutex_t* pmutex;
98 #elif defined(BLOCXX_WIN32)
100 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
103 namespace BLOCXX_NAMESPACE
106 typedef DWORD Thread_t;
107 typedef HANDLE NativeMutex_t;
108 typedef HANDLE NonRecursiveMutex_t;
109 typedef LPCRITICAL_SECTION Mutex_t;
117 CRITICAL_SECTION waitersCountLock;
129 typedef ConditionInfo_t* ConditionVar_t;
131 struct NonRecursiveMutexLockState
134 NativeMutex_t* pmutex;
141 #endif // #ifndef BLOCXX_THREAD_TYPES_HPP_