Skip to content

Commit f221ab2

Browse files
committed
---
yaml --- r: 13726 b: refs/heads/master c: 404afcb h: refs/heads/master v: v3
1 parent bba52df commit f221ab2

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 697f1e38d646bb6c7bab054c8c8c5b469c566ef6
2+
refs/heads/master: 404afcbb41898cf7f516f07cae3dc42e47bda46d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/arc.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,17 @@ impl methods<T: send> for exclusive<T> {
104104
arc_destruct(self.data)
105105
}
106106

107-
fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
108-
unsafe {
109-
let ptr: ~arc_data<ex_data<T>> =
110-
unsafe::reinterpret_cast(self.data);
111-
let r = {
112-
let rec: &ex_data<T> = &(*ptr).data;
113-
rec.lock.lock_cond() {|c|
114-
f(c, &rec.data)
115-
}
116-
};
117-
unsafe::forget(ptr);
118-
r
119-
}
107+
unsafe fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
108+
let ptr: ~arc_data<ex_data<T>> =
109+
unsafe::reinterpret_cast(self.data);
110+
let r = {
111+
let rec: &ex_data<T> = &(*ptr).data;
112+
rec.lock.lock_cond() {|c|
113+
f(c, &rec.data)
114+
}
115+
};
116+
unsafe::forget(ptr);
117+
r
120118
}
121119
}
122120

trunk/src/libcore/sys.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ fn create_lock() -> lock_and_signal {
106106
}
107107

108108
impl methods for lock_and_signal {
109-
fn lock<T>(f: fn() -> T) -> T {
109+
unsafe fn lock<T>(f: fn() -> T) -> T {
110110
rustrt::rust_lock_cond_lock(self.lock);
111111
let _r = unlock(self.lock);
112112
f()
113113
}
114114

115-
fn lock_cond<T>(f: fn(condition) -> T) -> T {
115+
unsafe fn lock_cond<T>(f: fn(condition) -> T) -> T {
116116
rustrt::rust_lock_cond_lock(self.lock);
117117
let _r = unlock(self.lock);
118118
f(condition_(self.lock))

0 commit comments

Comments
 (0)