diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-15 15:01:00 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-16 10:13:56 +1100 |
| commit | 4668cdf3c4788e4a67f1b7dea0eb2d661ac05a49 (patch) | |
| tree | 040ab0c33642c93b68c44fdd3db594cacab64a42 /src/libnative/task.rs | |
| parent | 5d86e24ab27dba0a773bd00a98e3845ece0ebf16 (diff) | |
| download | rust-4668cdf3c4788e4a67f1b7dea0eb2d661ac05a49.tar.gz rust-4668cdf3c4788e4a67f1b7dea0eb2d661ac05a49.zip | |
Convert some unnecessary StaticNativeMutexes to NativeMutexes.
Diffstat (limited to 'src/libnative/task.rs')
| -rw-r--r-- | src/libnative/task.rs | 12 |
1 files changed, 3 insertions, 9 deletions
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; |
