We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be664dd commit 2a128faCopy full SHA for 2a128fa
src/libcore/arc.rs
@@ -102,11 +102,14 @@ impl methods<T> for exclusive<T> {
102
fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
103
unsafe {
104
let ptr: ~arc_data<ex_data<T>> = unsafe::reinterpret_cast(*self);
105
- let rec: &ex_data<T> = &(*ptr).data;
+ let r = {
106
+ let rec: &ex_data<T> = &(*ptr).data;
107
+ rec.lock.lock_cond() {|c|
108
+ f(c, &rec.data)
109
+ }
110
+ };
111
unsafe::forget(ptr);
- rec.lock.lock_cond() {|c|
- f(c, &rec.data)
- }
112
+ r
113
}
114
115
0 commit comments