1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _WINDOWS_TIMEDRECMUTEX_H
21 #define _WINDOWS_TIMEDRECMUTEX_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
31
32
33
34 typedef struct
35 {
36 glwthread_initguard_t guard;
37 DWORD owner;
38 unsigned long depth;
39 HANDLE event;
40 CRITICAL_SECTION lock;
41 }
42 glwthread_timedrecmutex_t;
43
44 #define GLWTHREAD_TIMEDRECMUTEX_INIT { GLWTHREAD_INITGUARD_INIT, 0, 0 }
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 extern int glwthread_timedrecmutex_init (glwthread_timedrecmutex_t *mutex);
51 extern int glwthread_timedrecmutex_lock (glwthread_timedrecmutex_t *mutex);
52 extern int glwthread_timedrecmutex_trylock (glwthread_timedrecmutex_t *mutex);
53 extern int glwthread_timedrecmutex_timedlock (glwthread_timedrecmutex_t *mutex,
54 const struct timespec *abstime);
55 extern int glwthread_timedrecmutex_unlock (glwthread_timedrecmutex_t *mutex);
56 extern int glwthread_timedrecmutex_destroy (glwthread_timedrecmutex_t *mutex);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif