diff options
Diffstat (limited to 'src/libsync')
| -rw-r--r-- | src/libsync/mutex.rs | 8 | ||||
| -rw-r--r-- | src/libsync/raw.rs | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/libsync/mutex.rs b/src/libsync/mutex.rs index e41484c46bd..54c3a9c77f8 100644 --- a/src/libsync/mutex.rs +++ b/src/libsync/mutex.rs @@ -208,7 +208,7 @@ impl StaticMutex { // After we've failed the fast path, then we delegate to the differnet // locking protocols for green/native tasks. This will select two tasks // to continue further (one native, one green). - let t: ~Task = Local::take(); + let t: Box<Task> = Local::take(); let can_block = t.can_block(); let native_bit; if can_block { @@ -244,7 +244,7 @@ impl StaticMutex { // regularly in native/green contention. Due to try_lock and the header // of lock stealing the lock, it's also possible for native/native // contention to hit this location, but as less common. - let t: ~Task = Local::take(); + let t: Box<Task> = Local::take(); t.deschedule(1, |task| { let task = unsafe { task.cast_to_uint() }; @@ -308,7 +308,7 @@ impl StaticMutex { // Tasks which can block are super easy. These tasks just call the blocking // `lock()` function on an OS mutex - fn native_lock(&self, t: ~Task) { + fn native_lock(&self, t: Box<Task>) { Local::put(t); unsafe { self.lock.lock_noguard(); } } @@ -317,7 +317,7 @@ impl StaticMutex { unsafe { self.lock.unlock_noguard(); } } - fn green_lock(&self, t: ~Task) { + fn green_lock(&self, t: Box<Task>) { // Green threads flag their presence with an atomic counter, and if they // fail to be the first to the mutex, they enqueue themselves on a // concurrent internal queue with a stack-allocated node. diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs index 6ab833a19ef..313720fa932 100644 --- a/src/libsync/raw.rs +++ b/src/libsync/raw.rs @@ -167,7 +167,9 @@ impl<Q: Send> Sem<Q> { #[unsafe_destructor] impl<Q: Send> Drop for Sem<Q> { fn drop(&mut self) { - let _waiters: ~SemInner<Q> = unsafe { cast::transmute(self.inner) }; + let _waiters: Box<SemInner<Q>> = unsafe { + cast::transmute(self.inner) + }; self.inner = 0 as *(); } } @@ -835,7 +837,7 @@ mod tests { let m = Arc::new(Mutex::new()); let m2 = m.clone(); - let result: result::Result<(), ~Any:Send> = task::try(proc() { + let result: result::Result<(), Box<Any:Send>> = task::try(proc() { let _lock = m2.lock(); fail!(); }); @@ -1075,7 +1077,7 @@ mod tests { let x = Arc::new(RWLock::new()); let x2 = x.clone(); - let result: result::Result<(), ~Any:Send> = task::try(proc() { + let result: result::Result<(), Box<Any:Send>> = task::try(proc() { lock_rwlock_in_mode(&x2, mode1, || { fail!(); }) |
