mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 08:59:07 +00:00
feat(thread): add missing ctor/dtor to CSRWLock
This commit is contained in:
parent
8ba9a76bde
commit
048dab15cd
4 changed files with 34 additions and 0 deletions
|
|
@ -1,5 +1,27 @@
|
|||
#include "storm/thread/CSRWLock.hpp"
|
||||
|
||||
CSRWLock::CSRWLock() {
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
// TODO
|
||||
SRWLock::SURWLockInitialize(&this->m_opaqueData);
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
||||
pthread_rwlock_init(&this->m_lock, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
CSRWLock::~CSRWLock() {
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
SRWLock::SURWLockDelete(&this->m_opaqueData);
|
||||
// TODO
|
||||
#endif
|
||||
|
||||
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
||||
pthread_rwlock_destroy(&this->m_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CSRWLock::Enter(int32_t forwriting) {
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
SRWLock::SURWLockEnter(&this->m_opaqueData, forwriting);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ class CSRWLock {
|
|||
#endif
|
||||
|
||||
// Member functions
|
||||
CSRWLock();
|
||||
~CSRWLock();
|
||||
void Enter(int32_t forwriting);
|
||||
void Leave(int32_t fromwriting);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,14 @@ void SRWLock::SUNNLockLeave(volatile SUNNLOCK* sunnlock) {
|
|||
// TODO
|
||||
}
|
||||
|
||||
void SRWLock::SURWLockInitialize(volatile SRWLock::SURWLOCK* surwlock) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void SRWLock::SURWLockDelete(volatile SRWLock::SURWLOCK* surwlock) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void SRWLock::SURWLockEnter(volatile SURWLOCK* surwlock, int32_t forwriting) {
|
||||
// TODO
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ class SRWLock {
|
|||
// Static functions
|
||||
static void SUNNLockEnter(volatile SUNNLOCK* sunnlock);
|
||||
static void SUNNLockLeave(volatile SUNNLOCK* sunnlock);
|
||||
static void SURWLockInitialize(volatile SURWLOCK* surwlock);
|
||||
static void SURWLockDelete(volatile SURWLOCK* surwlock);
|
||||
static void SURWLockEnter(volatile SURWLOCK* surwlock, int32_t forwriting);
|
||||
static void SURWLockLeave(volatile SURWLOCK* surwlock, int32_t fromwriting);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue