diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-22 00:45:41 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-23 09:45:19 -0700 |
| commit | dd64bd83b72a669a20d1b7d938f1ff76aceb0cef (patch) | |
| tree | c1988740d6ae11cebfba3a3a946c4311425db55a /src/libstd/rt | |
| parent | da118e88d5f5814e5a7fad4dbeb8cc125054c5da (diff) | |
| download | rust-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/libstd/rt')
| -rw-r--r-- | src/libstd/rt/bookkeeping.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/rt/bookkeeping.rs b/src/libstd/rt/bookkeeping.rs index 5851a6a39c6..932cd7af033 100644 --- a/src/libstd/rt/bookkeeping.rs +++ b/src/libstd/rt/bookkeeping.rs @@ -34,7 +34,7 @@ pub fn increment() { pub fn decrement() { unsafe { if TASK_COUNT.fetch_sub(1, atomics::SeqCst) == 1 { - let mut guard = TASK_LOCK.lock(); + let guard = TASK_LOCK.lock(); guard.signal(); } } @@ -44,7 +44,7 @@ pub fn decrement() { /// the entry points of native programs pub fn wait_for_other_tasks() { unsafe { - let mut guard = TASK_LOCK.lock(); + let guard = TASK_LOCK.lock(); while TASK_COUNT.load(atomics::SeqCst) > 0 { guard.wait(); } |
