From 4668cdf3c4788e4a67f1b7dea0eb2d661ac05a49 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sat, 15 Feb 2014 15:01:00 +1100 Subject: Convert some unnecessary StaticNativeMutexes to NativeMutexes. --- src/libnative/task.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/libnative') diff --git a/src/libnative/task.rs b/src/libnative/task.rs index e4a8c45eb0b..d8f410834f2 100644 --- a/src/libnative/task.rs +++ b/src/libnative/task.rs @@ -22,7 +22,7 @@ use std::rt::task::{Task, BlockedTask, SendMessage}; use std::rt::thread::Thread; use std::rt; use std::task::TaskOpts; -use std::unstable::mutex::StaticNativeMutex; +use std::unstable::mutex::NativeMutex; use std::unstable::stack; use io; @@ -40,7 +40,7 @@ pub fn new(stack_bounds: (uint, uint)) -> ~Task { fn ops() -> ~Ops { ~Ops { - lock: unsafe { StaticNativeMutex::new() }, + lock: unsafe { NativeMutex::new() }, awoken: false, io: io::IoFactory::new(), // these *should* get overwritten @@ -109,7 +109,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) { // This structure is the glue between channels and the 1:1 scheduling mode. This // structure is allocated once per task. struct Ops { - lock: StaticNativeMutex, // native synchronization + lock: NativeMutex, // native synchronization awoken: bool, // used to prevent spurious wakeups io: io::IoFactory, // local I/O factory @@ -251,12 +251,6 @@ impl rt::Runtime for Ops { } } -impl Drop for Ops { - fn drop(&mut self) { - unsafe { self.lock.destroy() } - } -} - #[cfg(test)] mod tests { use std::rt::Runtime; -- cgit 1.4.1-3-g733a5