mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
27 lines
632 B
C++
27 lines
632 B
C++
|
|
#ifndef STORM_THREAD_WIN_S_RW_LOCK_HPP
|
||
|
|
#define STORM_THREAD_WIN_S_RW_LOCK_HPP
|
||
|
|
|
||
|
|
#include <cstdint>
|
||
|
|
|
||
|
|
class SRWLock {
|
||
|
|
public:
|
||
|
|
// Types
|
||
|
|
struct SUNNLOCK {
|
||
|
|
int32_t m_state;
|
||
|
|
int32_t m_event;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct SURWLOCK {
|
||
|
|
SRWLock::SUNNLOCK m_mutex;
|
||
|
|
int32_t m_readerEvent;
|
||
|
|
};
|
||
|
|
|
||
|
|
// Static functions
|
||
|
|
static void SUNNLockEnter(volatile SUNNLOCK* sunnlock);
|
||
|
|
static void SUNNLockLeave(volatile SUNNLOCK* sunnlock);
|
||
|
|
static void SURWLockEnter(volatile SURWLOCK* surwlock, int32_t forwriting);
|
||
|
|
static void SURWLockLeave(volatile SURWLOCK* surwlock, int32_t fromwriting);
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|