@@ -214,7 +214,7 @@ impl<T:Send> MutexArc<T> {
214214 * blocked on the mutex) will also fail immediately.
215215 */
216216 #[ 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 {
218218 let state = self . x . get ( ) ;
219219 // Borrowck would complain about this if the function were
220220 // not already unsafe. See borrow_rwlock, far below.
@@ -227,7 +227,7 @@ impl<T:Send> MutexArc<T> {
227227
228228 /// As access(), but with a condvar, as sync::mutex.lock_cond().
229229 #[ inline]
230- pub unsafe fn access_cond < ' x , ' c , U > ( & self ,
230+ pub unsafe fn unsafe_access_cond < ' x , ' c , U > ( & self ,
231231 blk : & fn ( x : & ' x mut T ,
232232 c : & ' c Condvar ) -> U )
233233 -> U {
@@ -597,12 +597,12 @@ mod tests {
597597 do task::spawn {
598598 // wait until parent gets in
599599 p.take().recv();
600- do arc2.access_cond |state, cond| {
600+ do arc2.unsafe_access_cond |state, cond| {
601601 *state = true;
602602 cond.signal();
603603 }
604604 }
605- do arc.access_cond |state, cond| {
605+ do arc.unsafe_access_cond |state, cond| {
606606 c.take().send(());
607607 assert!(!*state);
608608 while !*state {
@@ -621,14 +621,14 @@ mod tests {
621621
622622 do task::spawn_unlinked {
623623 let _ = p.recv();
624- do arc2.access_cond |one, cond| {
624+ do arc2.unsafe_access_cond |one, cond| {
625625 cond.signal();
626626 // Parent should fail when it wakes up.
627627 assert_eq!(*one, 0);
628628 }
629629 }
630630
631- do arc.access_cond |one, cond| {
631+ do arc.unsafe_access_cond |one, cond| {
632632 c.send(());
633633 while *one == 1 {
634634 cond.wait();
@@ -642,11 +642,11 @@ mod tests {
642642 let arc = MutexArc::new(1);
643643 let arc2 = arc.clone();
644644 do task::try {
645- do arc2.access |one| {
645+ do arc2.unsafe_access |one| {
646646 assert_eq!(*one, 2);
647647 }
648648 };
649- do arc.access |one| {
649+ do arc.unsafe_access |one| {
650650 assert_eq!(*one, 1);
651651 }
652652 }
@@ -658,7 +658,7 @@ mod tests {
658658 let (p, c) = comm::stream();
659659 do task::spawn {
660660 unsafe {
661- do arc2.access |one| {
661+ do arc2.unsafe_access |one| {
662662 c.send(());
663663 assert!(*one == 2);
664664 }
0 commit comments