diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-27 22:41:25 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 12:05:16 -0800 |
| commit | acacfb20fd34162cfba5a4e7b5f1447e0403fa50 (patch) | |
| tree | 0790d82726f49abc6d37b8ac5c8ca0fbec7e0685 /src/libextra | |
| parent | 984727ff87bb8a9f345ababf473d1141f9e05c08 (diff) | |
| download | rust-acacfb20fd34162cfba5a4e7b5f1447e0403fa50.tar.gz rust-acacfb20fd34162cfba5a4e7b5f1447e0403fa50.zip | |
Various bug fixes and rebase conflicts
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/sync/mutex.rs | 11 | ||||
| -rw-r--r-- | src/libextra/sync/one.rs | 6 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/libextra/sync/mutex.rs b/src/libextra/sync/mutex.rs index 6fb436d3528..7ea98c0741a 100644 --- a/src/libextra/sync/mutex.rs +++ b/src/libextra/sync/mutex.rs @@ -89,13 +89,6 @@ pub static NATIVE_BLOCKED: uint = 1 << 2; /// let guard = m.lock(); /// // do some work /// drop(guard); // unlock the lock -/// -/// { -/// let _g = m.lock(); -/// // do some work in a scope -/// } -/// -/// // now the mutex is unlocked /// ``` pub struct Mutex { priv lock: StaticMutex, @@ -541,9 +534,9 @@ mod test { let (p, c) = SharedChan::new(); for _ in range(0, N) { let c2 = c.clone(); - do native::task::spawn { inc(); c2.send(()); } + native::task::spawn(proc() { inc(); c2.send(()); }); let c2 = c.clone(); - do spawn { inc(); c2.send(()); } + spawn(proc() { inc(); c2.send(()); }); } drop(c); diff --git a/src/libextra/sync/one.rs b/src/libextra/sync/one.rs index 6dc1cbee6dc..826955d93e8 100644 --- a/src/libextra/sync/one.rs +++ b/src/libextra/sync/one.rs @@ -30,7 +30,7 @@ use sync::mutex::{StaticMutex, MUTEX_INIT}; /// # Example /// /// ```rust -/// use std::unstable::mutex::{Once, ONCE_INIT}; +/// use extra::sync::one::{Once, ONCE_INIT}; /// /// static mut START: Once = ONCE_INIT; /// unsafe { @@ -140,7 +140,7 @@ mod test { let (p, c) = SharedChan::new(); for _ in range(0, 10) { let c = c.clone(); - do spawn { + spawn(proc() { for _ in range(0, 4) { task::deschedule() } unsafe { o.doit(|| { @@ -150,7 +150,7 @@ mod test { assert!(run); } c.send(()); - } + }); } unsafe { |
