diff options
| author | Fenrir <[email protected]> | 2017-11-18 17:47:38 -0700 |
|---|---|---|
| committer | FenrirWolf <[email protected]> | 2017-11-18 18:20:21 -0700 |
| commit | 9f5d769afabc3bcaddf56568aced0df74a5fced6 (patch) | |
| tree | 41013f073f308aec847f143277904dd930008803 /ctr-std/src/sys | |
| parent | Merge pull request #44 from FenrirWolf/panic-unwind (diff) | |
| download | ctru-rs-9f5d769afabc3bcaddf56568aced0df74a5fced6.tar.xz ctru-rs-9f5d769afabc3bcaddf56568aced0df74a5fced6.zip | |
Update bindings for libctru v1.4.0
Diffstat (limited to 'ctr-std/src/sys')
| -rw-r--r-- | ctr-std/src/sys/unix/condvar.rs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/ctr-std/src/sys/unix/condvar.rs b/ctr-std/src/sys/unix/condvar.rs index b32298c..938df8f 100644 --- a/ctr-std/src/sys/unix/condvar.rs +++ b/ctr-std/src/sys/unix/condvar.rs @@ -17,11 +17,8 @@ use time::Duration; use sys::mutex::{self, Mutex}; -use libctru::{__sync_get_arbiter, LightLock}; -use libctru::{svcArbitrateAddress, ArbitrationType}; - pub struct Condvar { - lock: UnsafeCell<*mut LightLock>, + lock: UnsafeCell<*mut ::libctru::LightLock>, } unsafe impl Send for Condvar {} @@ -42,11 +39,11 @@ impl Condvar { #[inline] pub fn notify_one(&self) { unsafe { - let arbiter = __sync_get_arbiter(); + let arbiter = ::libctru::__sync_get_arbiter(); - svcArbitrateAddress(arbiter, + ::libctru::svcArbitrateAddress(arbiter, *self.lock.get() as u32, - ArbitrationType::ARBITRATION_SIGNAL, + ::libctru::ARBITRATION_SIGNAL, 1, 0); } @@ -61,11 +58,11 @@ impl Condvar { return; } - let arbiter = __sync_get_arbiter(); + let arbiter = ::libctru::__sync_get_arbiter(); - svcArbitrateAddress(arbiter, + ::libctru::svcArbitrateAddress(arbiter, *self.lock.get() as u32, - ArbitrationType::ARBITRATION_SIGNAL, + ::libctru::ARBITRATION_SIGNAL, -1, 0); } @@ -86,11 +83,11 @@ impl Condvar { mutex.unlock(); - let arbiter = __sync_get_arbiter(); + let arbiter = ::libctru::__sync_get_arbiter(); - svcArbitrateAddress(arbiter, + ::libctru::svcArbitrateAddress(arbiter, *self.lock.get() as u32, - ArbitrationType::ARBITRATION_WAIT_IF_LESS_THAN, + ::libctru::ARBITRATION_WAIT_IF_LESS_THAN, 2, 0); @@ -119,11 +116,11 @@ impl Condvar { mutex.unlock(); - let arbiter = __sync_get_arbiter(); + let arbiter = ::libctru::__sync_get_arbiter(); - svcArbitrateAddress(arbiter, + ::libctru::svcArbitrateAddress(arbiter, *self.lock.get() as u32, - ArbitrationType::ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, + ::libctru::ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 2, nanos as i64); |