diff --git a/src/libcore/arc.rs b/src/libcore/arc.rs index b28830db2806..2fd03cdb7a12 100644 --- a/src/libcore/arc.rs +++ b/src/libcore/arc.rs @@ -84,7 +84,7 @@ fn clone(rc: &arc) -> arc { } // An arc over mutable data that is protected by a lock. -type ex_data = {lock: sys::lock_and_signal, data: T}; +type ex_data = {lock: sys::lock_and_signal, mut data: T}; type exclusive = arc_destruct>; fn exclusive(-data: T) -> exclusive { @@ -110,12 +110,12 @@ impl methods for exclusive { arc_destruct(self.data) } - unsafe fn with(f: fn(sys::condition, x: &T) -> U) -> U { + unsafe fn with(f: fn(sys::condition, x: &mut T) -> U) -> U { let ptr: ~arc_data> = unsafe::reinterpret_cast(self.data); let r = { let rec: &ex_data = &(*ptr).data; - rec.lock.lock_cond(|c| f(c, &rec.data)) + rec.lock.lock_cond(|c| f(c, &mut rec.data)) }; unsafe::forget(ptr); r