1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _WINDOWS_TIMEDMUTEX_H
21 #define _WINDOWS_TIMEDMUTEX_H
22
23 #define WIN32_LEAN_AND_MEAN
24 #include <windows.h>
25
26 #include <time.h>
27
28 #include "windows-initguard.h"
29
30 typedef struct
31 {
32 glwthread_initguard_t guard;
33 HANDLE event;
34 CRITICAL_SECTION lock;
35 }
36 glwthread_timedmutex_t;
37
38 #define GLWTHREAD_TIMEDMUTEX_INIT { GLWTHREAD_INITGUARD_INIT }
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 extern int glwthread_timedmutex_init (glwthread_timedmutex_t *mutex);
45 extern int glwthread_timedmutex_lock (glwthread_timedmutex_t *mutex);
46 extern int glwthread_timedmutex_trylock (glwthread_timedmutex_t *mutex);
47 extern int glwthread_timedmutex_timedlock (glwthread_timedmutex_t *mutex,
48 const struct timespec *abstime);
49 extern int glwthread_timedmutex_unlock (glwthread_timedmutex_t *mutex);
50 extern int glwthread_timedmutex_destroy (glwthread_timedmutex_t *mutex);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif