Mark exclusive arc-related functions as unsafe. Fixes #2727.
This commit is contained in:
@@ -104,8 +104,7 @@ impl methods<T: send> for exclusive<T> {
|
||||
arc_destruct(self.data)
|
||||
}
|
||||
|
||||
fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
|
||||
unsafe {
|
||||
unsafe fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
|
||||
let ptr: ~arc_data<ex_data<T>> =
|
||||
unsafe::reinterpret_cast(self.data);
|
||||
let r = {
|
||||
@@ -117,7 +116,6 @@ impl methods<T: send> for exclusive<T> {
|
||||
unsafe::forget(ptr);
|
||||
r
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Convenience code for sharing arcs between tasks
|
||||
|
||||
@@ -106,13 +106,13 @@ fn create_lock() -> lock_and_signal {
|
||||
}
|
||||
|
||||
impl methods for lock_and_signal {
|
||||
fn lock<T>(f: fn() -> T) -> T {
|
||||
unsafe fn lock<T>(f: fn() -> T) -> T {
|
||||
rustrt::rust_lock_cond_lock(self.lock);
|
||||
let _r = unlock(self.lock);
|
||||
f()
|
||||
}
|
||||
|
||||
fn lock_cond<T>(f: fn(condition) -> T) -> T {
|
||||
unsafe fn lock_cond<T>(f: fn(condition) -> T) -> T {
|
||||
rustrt::rust_lock_cond_lock(self.lock);
|
||||
let _r = unlock(self.lock);
|
||||
f(condition_(self.lock))
|
||||
|
||||
Reference in New Issue
Block a user