27 |
|
int32 get_file_size( const char *path ); |
28 |
|
BOOL create_file( const char *path, DWORD size ); |
29 |
|
|
30 |
+ |
// Thread wrappers |
31 |
|
extern HANDLE create_thread(LPTHREAD_START_ROUTINE start_routine, void *arg = NULL); |
32 |
|
extern void wait_thread(HANDLE thread); |
33 |
|
extern void kill_thread(HANDLE thread); |
34 |
|
|
35 |
+ |
// Mutex wrappers |
36 |
+ |
class mutex_t { |
37 |
+ |
CRITICAL_SECTION cs; |
38 |
+ |
public: |
39 |
+ |
mutex_t() { InitializeCriticalSection(&cs); } |
40 |
+ |
~mutex_t() { DeleteCriticalSection(&cs); } |
41 |
+ |
void lock() { EnterCriticalSection(&cs); } |
42 |
+ |
void unlock() { LeaveCriticalSection(&cs); } |
43 |
+ |
}; |
44 |
+ |
|
45 |
|
#endif // _UTIL_WINDOWS_H |