diff options
| author | Fenrir <[email protected]> | 2017-06-06 17:10:20 -0600 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2017-07-10 11:30:57 -0600 |
| commit | a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2 (patch) | |
| tree | 21cd16fab40e0d8368f06f383d47e6741ea9c383 /ctr-std/src/sys/unix/mutex.rs | |
| parent | Handle linking in ctru-rs build script (diff) | |
| download | archived-ctru-rs-a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2.tar.xz archived-ctru-rs-a572fa0a5aca2c990ecc5a8a0aaf48df4b67c4f2.zip | |
Update libraries for ctru-sys changes
Diffstat (limited to 'ctr-std/src/sys/unix/mutex.rs')
| -rw-r--r-- | ctr-std/src/sys/unix/mutex.rs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/ctr-std/src/sys/unix/mutex.rs b/ctr-std/src/sys/unix/mutex.rs index d4fd2c2..0cfd392 100644 --- a/ctr-std/src/sys/unix/mutex.rs +++ b/ctr-std/src/sys/unix/mutex.rs @@ -11,12 +11,10 @@ use cell::UnsafeCell; use mem; -use libctru::synchronization; - -pub struct Mutex { inner: UnsafeCell<synchronization::LightLock> } +pub struct Mutex { inner: UnsafeCell<::libctru::LightLock> } #[inline] -pub unsafe fn raw(m: &Mutex) -> *mut synchronization::LightLock { +pub unsafe fn raw(m: &Mutex) -> *mut ::libctru::LightLock { m.inner.get() } @@ -30,19 +28,19 @@ impl Mutex { } #[inline] pub unsafe fn init(&mut self) { - synchronization::LightLock_Init(self.inner.get()); + ::libctru::LightLock_Init(self.inner.get()); } #[inline] pub unsafe fn lock(&self) { - synchronization::LightLock_Lock(self.inner.get()); + ::libctru::LightLock_Lock(self.inner.get()); } #[inline] pub unsafe fn unlock(&self) { - synchronization::LightLock_Unlock(self.inner.get()); + ::libctru::LightLock_Unlock(self.inner.get()); } #[inline] pub unsafe fn try_lock(&self) -> bool { - match synchronization::LightLock_TryLock(self.inner.get()) { + match ::libctru::LightLock_TryLock(self.inner.get()) { 0 => true, _ => false, } @@ -51,7 +49,7 @@ impl Mutex { pub unsafe fn destroy(&self) {} } -pub struct ReentrantMutex { inner: UnsafeCell<synchronization::RecursiveLock> } +pub struct ReentrantMutex { inner: UnsafeCell<::libctru::RecursiveLock> } unsafe impl Send for ReentrantMutex {} unsafe impl Sync for ReentrantMutex {} @@ -62,19 +60,19 @@ impl ReentrantMutex { } #[inline] pub unsafe fn init(&mut self) { - synchronization::RecursiveLock_Init(self.inner.get()); + ::libctru::RecursiveLock_Init(self.inner.get()); } #[inline] pub unsafe fn lock(&self) { - synchronization::RecursiveLock_Lock(self.inner.get()); + ::libctru::RecursiveLock_Lock(self.inner.get()); } #[inline] pub unsafe fn unlock(&self) { - synchronization::RecursiveLock_Unlock(self.inner.get()); + ::libctru::RecursiveLock_Unlock(self.inner.get()); } #[inline] pub unsafe fn try_lock(&self) -> bool { - match synchronization::RecursiveLock_TryLock(self.inner.get()) { + match ::libctru::RecursiveLock_TryLock(self.inner.get()) { 0 => true, _ => false, } |