Reference fixes.
This commit is contained in:
parent
be664ddd29
commit
2a128fa205
@ -102,11 +102,14 @@ fn clone() -> exclusive<T> {
|
||||
fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
|
||||
unsafe {
|
||||
let ptr: ~arc_data<ex_data<T>> = unsafe::reinterpret_cast(*self);
|
||||
let rec: &ex_data<T> = &(*ptr).data;
|
||||
let r = {
|
||||
let rec: &ex_data<T> = &(*ptr).data;
|
||||
rec.lock.lock_cond() {|c|
|
||||
f(c, &rec.data)
|
||||
}
|
||||
};
|
||||
unsafe::forget(ptr);
|
||||
rec.lock.lock_cond() {|c|
|
||||
f(c, &rec.data)
|
||||
}
|
||||
r
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user