about summary refs log tree commit diff
path: root/src/libnative/task.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-22 00:45:41 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-03-23 09:45:19 -0700
commitdd64bd83b72a669a20d1b7d938f1ff76aceb0cef (patch)
treec1988740d6ae11cebfba3a3a946c4311425db55a /src/libnative/task.rs
parentda118e88d5f5814e5a7fad4dbeb8cc125054c5da (diff)
downloadrust-dd64bd83b72a669a20d1b7d938f1ff76aceb0cef.tar.gz
rust-dd64bd83b72a669a20d1b7d938f1ff76aceb0cef.zip
std: Move NativeMutex from &mut self to &self
The proper usage of shared types is now sharing through `&self` rather than
`&mut self` because the mutable version will provide stronger guarantees (no
aliasing on *any* thread).
Diffstat (limited to 'src/libnative/task.rs')
-rw-r--r--src/libnative/task.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnative/task.rs b/src/libnative/task.rs
index 7a42d1bfee3..659e417b8ad 100644
--- a/src/libnative/task.rs
+++ b/src/libnative/task.rs
@@ -190,7 +190,7 @@ impl rt::Runtime for Ops {
             let task = BlockedTask::block(cur_task);
 
             if times == 1 {
-                let mut guard = (*me).lock.lock();
+                let guard = (*me).lock.lock();
                 (*me).awoken = false;
                 match f(task) {
                     Ok(()) => {
@@ -202,7 +202,7 @@ impl rt::Runtime for Ops {
                 }
             } else {
                 let mut iter = task.make_selectable(times);
-                let mut guard = (*me).lock.lock();
+                let guard = (*me).lock.lock();
                 (*me).awoken = false;
                 let success = iter.all(|task| {
                     match f(task) {
@@ -232,7 +232,7 @@ impl rt::Runtime for Ops {
             let me = &mut *self as *mut Ops;
             to_wake.put_runtime(self as ~rt::Runtime);
             cast::forget(to_wake);
-            let mut guard = (*me).lock.lock();
+            let guard = (*me).lock.lock();
             (*me).awoken = true;
             guard.signal();
         }