summaryrefslogtreecommitdiff
path: root/Runtime/Threads/Winapi/PlatformMutex.h
blob: 11f174e0e59bba1c8306c1df1085c7489a35ed09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef __PLATFORMMUTEX_H
#define __PLATFORMMUTEX_H

#if SUPPORT_THREADS

#include "Runtime/Utilities/NonCopyable.h"

/**
 *	A platform/api specific mutex class. Always recursive (a single thread can lock multiple times).
 */
class PlatformMutex : public NonCopyable
{
	friend class Mutex;
protected:
	PlatformMutex();
	~PlatformMutex();

	void Lock();
	void Unlock();
	bool TryLock();

private:

	CRITICAL_SECTION crit_sec;
};

#endif // SUPPORT_THREADS
#endif // __PLATFORMMUTEX_H