@@ -214,7 +214,7 @@ impl<T:Send> MutexArc<T> {
214
214
* blocked on the mutex) will also fail immediately.
215
215
*/
216
216
#[ inline]
217
- pub unsafe fn access < U > ( & self , blk : & fn ( x : & mut T ) -> U ) -> U {
217
+ pub unsafe fn unsafe_access < U > ( & self , blk : & fn ( x : & mut T ) -> U ) -> U {
218
218
let state = self . x . get ( ) ;
219
219
// Borrowck would complain about this if the function were
220
220
// not already unsafe. See borrow_rwlock, far below.
@@ -227,7 +227,7 @@ impl<T:Send> MutexArc<T> {
227
227
228
228
/// As access(), but with a condvar, as sync::mutex.lock_cond().
229
229
#[ inline]
230
- pub unsafe fn access_cond < ' x , ' c , U > ( & self ,
230
+ pub unsafe fn unsafe_access_cond < ' x , ' c , U > ( & self ,
231
231
blk : & fn ( x : & ' x mut T ,
232
232
c : & ' c Condvar ) -> U )
233
233
-> U {
@@ -597,12 +597,12 @@ mod tests {
597
597
do task::spawn {
598
598
// wait until parent gets in
599
599
p.take().recv();
600
- do arc2.access_cond |state, cond| {
600
+ do arc2.unsafe_access_cond |state, cond| {
601
601
*state = true;
602
602
cond.signal();
603
603
}
604
604
}
605
- do arc.access_cond |state, cond| {
605
+ do arc.unsafe_access_cond |state, cond| {
606
606
c.take().send(());
607
607
assert!(!*state);
608
608
while !*state {
@@ -621,14 +621,14 @@ mod tests {
621
621
622
622
do task::spawn_unlinked {
623
623
let _ = p.recv();
624
- do arc2.access_cond |one, cond| {
624
+ do arc2.unsafe_access_cond |one, cond| {
625
625
cond.signal();
626
626
// Parent should fail when it wakes up.
627
627
assert_eq!(*one, 0);
628
628
}
629
629
}
630
630
631
- do arc.access_cond |one, cond| {
631
+ do arc.unsafe_access_cond |one, cond| {
632
632
c.send(());
633
633
while *one == 1 {
634
634
cond.wait();
@@ -642,11 +642,11 @@ mod tests {
642
642
let arc = MutexArc::new(1);
643
643
let arc2 = arc.clone();
644
644
do task::try {
645
- do arc2.access |one| {
645
+ do arc2.unsafe_access |one| {
646
646
assert_eq!(*one, 2);
647
647
}
648
648
};
649
- do arc.access |one| {
649
+ do arc.unsafe_access |one| {
650
650
assert_eq!(*one, 1);
651
651
}
652
652
}
@@ -658,7 +658,7 @@ mod tests {
658
658
let (p, c) = comm::stream();
659
659
do task::spawn {
660
660
unsafe {
661
- do arc2.access |one| {
661
+ do arc2.unsafe_access |one| {
662
662
c.send(());
663
663
assert!(*one == 2);
664
664
}
0 commit comments