4 pub struct RWLock { inner: UnsafeCell<c::SRWLOCK> }
6 unsafe impl Send for RWLock {}
7 unsafe impl Sync for RWLock {}
10 pub const fn new() -> RWLock {
11 RWLock { inner: UnsafeCell::new(c::SRWLOCK_INIT) }
14 pub unsafe fn read(&self) {
15 c::AcquireSRWLockShared(self.inner.get())
18 pub unsafe fn try_read(&self) -> bool {
19 c::TryAcquireSRWLockShared(self.inner.get()) != 0
22 pub unsafe fn write(&self) {
23 c::AcquireSRWLockExclusive(self.inner.get())
26 pub unsafe fn try_write(&self) -> bool {
27 c::TryAcquireSRWLockExclusive(self.inner.get()) != 0
30 pub unsafe fn read_unlock(&self) {
31 c::ReleaseSRWLockShared(self.inner.get())
34 pub unsafe fn write_unlock(&self) {
35 c::ReleaseSRWLockExclusive(self.inner.get())
39 pub unsafe fn destroy(&self) {