Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
posixreadwritelock.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
9
//------------------------------------------------------------------------------
10
#include <pthread.h>
11
#include "
threading/threadid.h
"
12
namespace
Posix
13
{
14
15
class
PosixReadWriteLock
16
{
17
public
:
19
PosixReadWriteLock
();
21
~PosixReadWriteLock
();
22
24
void
LockRead
();
26
void
LockWrite
();
27
29
void
UnlockRead
();
31
void
UnlockWrite
();
32
33
private
:
34
int32_t
readCounter
= 0;
35
int32_t
writeCounter
= 0;
36
pthread_rwlock_t
lock
;
37
Threading::ThreadId
lockingThread
= 0;
38
};
39
40
}
// namespace Posix
Posix::PosixReadWriteLock::writeCounter
int32_t writeCounter
Definition
posixreadwritelock.h:35
Posix::PosixReadWriteLock::lock
pthread_rwlock_t lock
Definition
posixreadwritelock.h:36
Posix::PosixReadWriteLock::~PosixReadWriteLock
~PosixReadWriteLock()
Destructor.
Definition
posixreadwritelock.cc:24
Posix::PosixReadWriteLock::UnlockRead
void UnlockRead()
Release read.
Definition
posixreadwritelock.cc:61
Posix::PosixReadWriteLock::LockWrite
void LockWrite()
Lock for write.
Definition
posixreadwritelock.cc:45
Posix::PosixReadWriteLock::UnlockWrite
void UnlockWrite()
Release write.
Definition
posixreadwritelock.cc:72
Posix::PosixReadWriteLock::lockingThread
Threading::ThreadId lockingThread
Definition
posixreadwritelock.h:37
Posix::PosixReadWriteLock::readCounter
int32_t readCounter
Definition
posixreadwritelock.h:34
Posix::PosixReadWriteLock::LockRead
void LockRead()
Lock for read.
Definition
posixreadwritelock.cc:34
Posix::PosixReadWriteLock::PosixReadWriteLock
PosixReadWriteLock()
Constructor.
Definition
posixreadwritelock.cc:15
Posix
Posix implemention of a read-many write-few lock.
Definition
posixsysfunc.cc:21
Threading::ThreadId
pthread_t ThreadId
Definition
linuxthreadid.h:15
threadid.h
code
foundation
threading
posix
posixreadwritelock.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.