Skip to content

Commit 1b60b08

Browse files
committed
---
yaml --- r: 24569 b: refs/heads/try2 c: 5bfb5ca h: refs/heads/master i: 24567: 95547c2 v: v3
1 parent 62dc306 commit 1b60b08

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 27cecbf1cf4f87b12b43dd9ae253c20598858ced
8+
refs/heads/try2: 5bfb5cad3a8d5f9c1819472bcd166f8ed8972b6d
99
refs/heads/incoming: 05543fd04dfb3f63b453a331e239ceb1a9a219f9
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ex_data<T: send> = {lock: sys::lock_and_signal, data: T};
8888
type exclusive<T: send> = arc_destruct<ex_data<T>>;
8989

9090
fn exclusive<T:send >(-data: T) -> exclusive<T> {
91-
let data = ~{mut count: 1, data: {lock: sys::create_lock(),
91+
let data = ~{mut count: 1, data: {lock: sys::lock_and_signal(),
9292
data: data}};
9393
unsafe {
9494
let ptr = unsafe::reinterpret_cast(data);

branches/try2/src/libcore/sys.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export min_align_of;
77
export pref_align_of;
88
export refcount;
99
export log_str;
10-
export create_lock, lock_and_signal, condition, methods;
10+
export lock_and_signal, condition, methods;
1111

1212
enum type_desc = {
1313
first_param: **libc::c_int,
@@ -87,7 +87,9 @@ pure fn log_str<T>(t: T) -> str {
8787

8888
class lock_and_signal {
8989
let lock: rust_cond_lock;
90-
new(lock: rust_cond_lock) { self.lock = lock; }
90+
new() {
91+
self.lock = rustrt::rust_create_cond_lock();
92+
}
9193
drop { rustrt::rust_destroy_cond_lock(self.lock); }
9294
}
9395

@@ -101,10 +103,6 @@ class unlock {
101103
drop { rustrt::rust_unlock_cond_lock(self.lock); }
102104
}
103105

104-
fn create_lock() -> lock_and_signal {
105-
lock_and_signal(rustrt::rust_create_cond_lock())
106-
}
107-
108106
impl methods for lock_and_signal {
109107
unsafe fn lock<T>(f: fn() -> T) -> T {
110108
rustrt::rust_lock_cond_lock(self.lock);
@@ -180,7 +178,7 @@ mod tests {
180178
#[test]
181179
#[ignore] // this can go into infinite loops
182180
fn condition_variable() {
183-
let lock = arc::arc(create_lock());
181+
let lock = arc::arc(lock_and_signal());
184182
let lock2 = arc::clone(&lock);
185183

186184
do task::spawn |move lock2| {

0 commit comments

Comments
 (0)