@@ -50,13 +50,13 @@ concurrency at this writing:
50
50
* [ ` sync::DuplexStream ` ] - An extension of ` pipes::stream ` that allows both sending and receiving,
51
51
* [ ` sync::SyncChan ` ] - An extension of ` pipes::stream ` that provides synchronous message sending,
52
52
* [ ` sync::SyncPort ` ] - An extension of ` pipes::stream ` that acknowledges each message received,
53
- * [ ` sync::rendezvous ` ] - Creates a stream whose channel, upon sending a message, blocks until the
53
+ * [ ` sync::rendezvous ` ] - Creates a stream whose channel, upon sending a message, blocks until the
54
54
message is received.
55
55
* [ ` sync::Arc ` ] - The Arc (atomically reference counted) type, for safely sharing immutable data,
56
56
* [ ` sync::RWArc ` ] - A dual-mode Arc protected by a reader-writer lock,
57
57
* [ ` sync::MutexArc ` ] - An Arc with mutable data protected by a blocking mutex,
58
58
* [ ` sync::Semaphore ` ] - A counting, blocking, bounded-waiting semaphore,
59
- * [ ` sync::Mutex ` ] - A blocking, bounded-waiting, mutual exclusion lock with an associated
59
+ * [ ` sync::Mutex ` ] - A blocking, bounded-waiting, mutual exclusion lock with an associated
60
60
FIFO condition variable,
61
61
* [ ` sync::RWLock ` ] - A blocking, no-starvation, reader-writer lock with an associated condvar,
62
62
* [ ` sync::Barrier ` ] - A barrier enables multiple tasks to synchronize the beginning
@@ -343,8 +343,8 @@ a single large vector of floats. Each task needs the full vector to perform its
343
343
344
344
~~~
345
345
# extern crate sync;
346
+ extern crate rand;
346
347
# use std::vec;
347
- # use std::rand;
348
348
use sync::Arc;
349
349
350
350
fn pnorm(nums: &~[f64], p: uint) -> f64 {
@@ -376,9 +376,9 @@ created by the line
376
376
377
377
~~~
378
378
# extern crate sync;
379
+ # extern crate rand;
379
380
# use sync::Arc;
380
381
# use std::vec;
381
- # use std::rand;
382
382
# fn main() {
383
383
# let numbers = vec::from_fn(1000000, |_| rand::random::<f64>());
384
384
let numbers_arc=Arc::new(numbers);
@@ -389,9 +389,9 @@ and a clone of it is sent to each task
389
389
390
390
~~~
391
391
# extern crate sync;
392
+ # extern crate rand;
392
393
# use sync::Arc;
393
394
# use std::vec;
394
- # use std::rand;
395
395
# fn main() {
396
396
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
397
397
# let numbers_arc = Arc::new(numbers);
@@ -406,9 +406,9 @@ Each task recovers the underlying data by
406
406
407
407
~~~
408
408
# extern crate sync;
409
+ # extern crate rand;
409
410
# use sync::Arc;
410
411
# use std::vec;
411
- # use std::rand;
412
412
# fn main() {
413
413
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
414
414
# let numbers_arc=Arc::new(numbers);
0 commit comments