summaryrefslogtreecommitdiff
path: root/drivers/unix/rw_lock_posix.h
blob: bcc102f6a6358e9403aca6020cabac29dd1985b7 (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
29
30
31
32
33
34
35
36
37
#ifndef RWLOCKPOSIX_H
#define RWLOCKPOSIX_H

#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)

#include <pthread.h>
#include "os/rw_lock.h"

class RWLockPosix : public RWLock {


	pthread_rwlock_t rwlock;

	static RWLock *create_func_posix();

public:

	virtual void read_lock();
	virtual void read_unlock();
	virtual Error read_try_lock();

	virtual void write_lock();
	virtual void write_unlock();
	virtual Error write_try_lock();

	static void make_default();

	RWLockPosix();

	~RWLockPosix();

};

#endif


#endif // RWLOCKPOSIX_H