feat(thread): implement CSRWLock::Enter and CSRWLock::Leave for windows (#1)

This commit is contained in:
fallenoak 2020-12-01 17:40:37 -06:00 committed by GitHub
parent 8210d368f6
commit 2fb9fd284c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 6 deletions

View file

@ -0,0 +1,17 @@
#include "storm/thread/win/SRWLock.hpp"
void SRWLock::SUNNLockEnter(volatile SUNNLOCK* sunnlock) {
// TODO
}
void SRWLock::SUNNLockLeave(volatile SUNNLOCK* sunnlock) {
// TODO
}
void SRWLock::SURWLockEnter(volatile SURWLOCK* surwlock, int32_t forwriting) {
// TODO
}
void SRWLock::SURWLockLeave(volatile SURWLOCK* surwlock, int32_t fromwriting) {
// TODO
}

View file

@ -0,0 +1,26 @@
#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