File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ BEGIN_EXTERN_C
12
12
#define hmutex_init InitializeCriticalSection
13
13
#define hmutex_destroy DeleteCriticalSection
14
14
#define hmutex_lock EnterCriticalSection
15
+ #define hmutex_trylock TryEnterCriticalSection
15
16
#define hmutex_unlock LeaveCriticalSection
16
17
17
18
#define hrecursive_mutex_t CRITICAL_SECTION
@@ -79,6 +80,7 @@ static inline void honce(honce_t* once, honce_fn fn) {
79
80
#define hmutex_init (pmutex ) pthread_mutex_init(pmutex, NULL )
80
81
#define hmutex_destroy pthread_mutex_destroy
81
82
#define hmutex_lock pthread_mutex_lock
83
+ #define hmutex_trylock (pmutex ) (pthread_mutex_trylock(pmutex) == 0 )
82
84
#define hmutex_unlock pthread_mutex_unlock
83
85
84
86
#define hrecursive_mutex_t pthread_mutex_t
You can’t perform that action at this time.
0 commit comments