summaryrefslogtreecommitdiff
path: root/Source/Kernel/TaskManager/Mutex.class.h
blob: 55455594e428430a18cd963065f99b281b8b85c2 (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 <Core/common.wtf.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