@@ -10,13 +10,13 @@ import unsafe::{SharedMutableState, shared_mutable_state,
10
10
clone_shared_mutable_state, unwrap_shared_mutable_state,
11
11
get_shared_mutable_state, get_shared_immutable_state} ;
12
12
import sync;
13
- import sync:: { Mutex , mutex , mutex_with_condvars,
14
- RWlock , rwlock , rwlock_with_condvars} ;
13
+ import sync:: { Mutex , mutex_with_condvars,
14
+ RWlock , rwlock_with_condvars} ;
15
15
16
- export ARC , arc , clone, get;
16
+ export ARC , clone, get;
17
17
export Condvar ;
18
- export MutexARC , mutex_arc , mutex_arc_with_condvars, unwrap_mutex_arc;
19
- export RWARC , rw_arc , rw_arc_with_condvars, RWWriteMode , RWReadMode ;
18
+ export MutexARC , mutex_arc_with_condvars, unwrap_mutex_arc;
19
+ export RWARC , rw_arc_with_condvars, RWWriteMode , RWReadMode ;
20
20
export unwrap_rw_arc;
21
21
22
22
/// As sync::condvar, a mechanism for unlock-and-descheduling and signalling.
@@ -73,7 +73,7 @@ impl &Condvar {
73
73
struct ARC < T : const send > { x : SharedMutableState < T > ; }
74
74
75
75
/// Create an atomically reference counted wrapper.
76
- fn arc < T : const send > ( +data : T ) -> ARC < T > {
76
+ fn ARC < T : const send > ( +data : T ) -> ARC < T > {
77
77
ARC { x : unsafe { shared_mutable_state ( data) } }
78
78
}
79
79
@@ -120,7 +120,7 @@ struct MutexARCInner<T: send> { lock: Mutex; failed: bool; data: T; }
120
120
struct MutexARC < T : send > { x : SharedMutableState < MutexARCInner < T > > ; }
121
121
122
122
/// Create a mutex-protected ARC with the supplied data.
123
- fn mutex_arc < T : send > ( +user_data : T ) -> MutexARC < T > {
123
+ fn MutexARC < T : send > ( +user_data : T ) -> MutexARC < T > {
124
124
mutex_arc_with_condvars ( user_data, 1 )
125
125
}
126
126
/**
@@ -249,7 +249,7 @@ struct RWARC<T: const send> {
249
249
}
250
250
251
251
/// Create a reader/writer ARC with the supplied data.
252
- fn rw_arc <T: const send>(+user_data: T) -> RWARC<T> {
252
+ fn RWARC <T: const send>(+user_data: T) -> RWARC<T> {
253
253
rw_arc_with_condvars(user_data, 1)
254
254
}
255
255
/**
@@ -445,7 +445,7 @@ mod tests {
445
445
#[ test]
446
446
fn manually_share_arc ( ) {
447
447
let v = ~[ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ;
448
- let arc_v = arc:: arc ( v) ;
448
+ let arc_v = arc:: ARC ( v) ;
449
449
450
450
let ( c, p) = pipes:: stream ( ) ;
451
451
@@ -469,7 +469,7 @@ mod tests {
469
469
470
470
#[ test]
471
471
fn test_mutex_arc_condvar ( ) {
472
- let arc = ~mutex_arc ( false ) ;
472
+ let arc = ~MutexARC ( false ) ;
473
473
let arc2 = ~arc. clone ( ) ;
474
474
let ( c, p) = pipes:: oneshot ( ) ;
475
475
let ( c, p) = ( ~mut Some ( c) , ~mut Some ( p) ) ;
@@ -491,7 +491,7 @@ mod tests {
491
491
}
492
492
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
493
493
fn test_arc_condvar_poison ( ) {
494
- let arc = ~mutex_arc ( 1 ) ;
494
+ let arc = ~MutexARC ( 1 ) ;
495
495
let arc2 = ~arc. clone ( ) ;
496
496
let ( c, p) = pipes:: stream ( ) ;
497
497
@@ -512,7 +512,7 @@ mod tests {
512
512
}
513
513
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
514
514
fn test_mutex_arc_poison ( ) {
515
- let arc = ~mutex_arc ( 1 ) ;
515
+ let arc = ~MutexARC ( 1 ) ;
516
516
let arc2 = ~arc. clone ( ) ;
517
517
do task:: try {
518
518
do arc2. access |one| {
@@ -525,7 +525,7 @@ mod tests {
525
525
}
526
526
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
527
527
fn test_mutex_arc_unwrap_poison ( ) {
528
- let arc = mutex_arc ( 1 ) ;
528
+ let arc = MutexARC ( 1 ) ;
529
529
let arc2 = ~( & arc) . clone ( ) ;
530
530
let ( c, p) = pipes:: stream ( ) ;
531
531
do task:: spawn {
@@ -540,7 +540,7 @@ mod tests {
540
540
}
541
541
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
542
542
fn test_rw_arc_poison_wr ( ) {
543
- let arc = ~rw_arc ( 1 ) ;
543
+ let arc = ~RWARC ( 1 ) ;
544
544
let arc2 = ~arc. clone ( ) ;
545
545
do task:: try {
546
546
do arc2. write |one| {
@@ -553,7 +553,7 @@ mod tests {
553
553
}
554
554
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
555
555
fn test_rw_arc_poison_ww ( ) {
556
- let arc = ~rw_arc ( 1 ) ;
556
+ let arc = ~RWARC ( 1 ) ;
557
557
let arc2 = ~arc. clone ( ) ;
558
558
do task:: try {
559
559
do arc2. write |one| {
@@ -566,7 +566,7 @@ mod tests {
566
566
}
567
567
#[ test] #[ should_fail] #[ ignore( cfg( windows) ) ]
568
568
fn test_rw_arc_poison_dw ( ) {
569
- let arc = ~rw_arc ( 1 ) ;
569
+ let arc = ~RWARC ( 1 ) ;
570
570
let arc2 = ~arc. clone ( ) ;
571
571
do task:: try {
572
572
do arc2. write_downgrade |write_mode| {
@@ -581,7 +581,7 @@ mod tests {
581
581
}
582
582
#[ test] #[ ignore( cfg( windows) ) ]
583
583
fn test_rw_arc_no_poison_rr ( ) {
584
- let arc = ~rw_arc ( 1 ) ;
584
+ let arc = ~RWARC ( 1 ) ;
585
585
let arc2 = ~arc. clone ( ) ;
586
586
do task:: try {
587
587
do arc2. read |one| {
@@ -594,7 +594,7 @@ mod tests {
594
594
}
595
595
#[ test] #[ ignore( cfg( windows) ) ]
596
596
fn test_rw_arc_no_poison_rw ( ) {
597
- let arc = ~rw_arc ( 1 ) ;
597
+ let arc = ~RWARC ( 1 ) ;
598
598
let arc2 = ~arc. clone ( ) ;
599
599
do task:: try {
600
600
do arc2. read |one| {
@@ -607,7 +607,7 @@ mod tests {
607
607
}
608
608
#[ test] #[ ignore( cfg( windows) ) ]
609
609
fn test_rw_arc_no_poison_dr ( ) {
610
- let arc = ~rw_arc ( 1 ) ;
610
+ let arc = ~RWARC ( 1 ) ;
611
611
let arc2 = ~arc. clone ( ) ;
612
612
do task:: try {
613
613
do arc2. write_downgrade |write_mode| {
@@ -623,7 +623,7 @@ mod tests {
623
623
}
624
624
#[ test]
625
625
fn test_rw_arc ( ) {
626
- let arc = ~rw_arc ( 0 ) ;
626
+ let arc = ~RWARC ( 0 ) ;
627
627
let arc2 = ~arc. clone ( ) ;
628
628
let ( c, p) = pipes:: stream ( ) ;
629
629
@@ -662,7 +662,7 @@ mod tests {
662
662
// (4) tells writer and all other readers to contend as it downgrades.
663
663
// (5) Writer attempts to set state back to 42, while downgraded task
664
664
// and all reader tasks assert that it's 31337.
665
- let arc = ~rw_arc ( 0 ) ;
665
+ let arc = ~RWARC ( 0 ) ;
666
666
667
667
// Reader tasks
668
668
let mut reader_convos = ~[ ] ;
0 commit comments