Reference fixes.

This commit is contained in:
Eric Holk 2012-06-15 22:14:02 -04:00
parent be664ddd29
commit 2a128fa205

View File

@ -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
}
}
}