summaryrefslogtreecommitdiff
path: root/Source/Library/Common/Mutex.class.h
blob: 1e3f63db90075afbefe134db503e69ec97940f38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef DEF_MUTEX_CLASS_H
#define DEF_MUTEX_CLASS_H

#include <common.h>

#define MUTEX_FALSE 0
#define MUTEX_TRUE 1

class Mutex {
	private:
	u32int m_locked;

	public:
	Mutex(u32int locked = MUTEX_FALSE);
	bool lock();		//Locks the mutex if it is not locked. Returns true if mutex could be locked, false if already locked
	void waitLock();	//Locks the mutex, waiting for it to be unlocked before if necessary
	void unlock();
	bool locked();
};

#endif