Skip to content

Commit da4a969

Browse files
committed
---
yaml --- r: 38860 b: refs/heads/incoming c: 563aa0b h: refs/heads/master v: v3
1 parent 7290983 commit da4a969

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: a0066082764456d642e25ae9ae780e1952cf1b94
9+
refs/heads/incoming: 563aa0bf6c932b2150557b335f9a40675639c323
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/private.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ extern mod rustrt {
1313
fn rust_task_weaken(ch: rust_port_id);
1414
fn rust_task_unweaken(ch: rust_port_id);
1515

16-
#[rust_stack]
17-
fn rust_compare_and_swap_ptr(address: &mut libc::uintptr_t,
18-
oldval: libc::uintptr_t,
19-
newval: libc::uintptr_t) -> bool;
20-
2116
fn rust_create_little_lock() -> rust_little_lock;
2217
fn rust_destroy_little_lock(lock: rust_little_lock);
2318
fn rust_lock_little_lock(lock: rust_little_lock);
@@ -291,11 +286,11 @@ pub fn test_weaken_task_fail() {
291286
// An unwrapper uses this protocol to communicate with the "other" task that
292287
// drops the last refcount on an arc. Unfortunately this can't be a proper
293288
// pipe protocol because the unwrapper has to access both stages at once.
294-
type UnwrapProto = ~mut Option<(pipes::ChanOne<()>, pipes::PortOne<bool>)>;
289+
type UnwrapProto = ~mut Option<(pipes::ChanOne<()>, pipes::PortOne<bool>)>;
295290

296291
struct ArcData<T> {
297292
mut count: libc::intptr_t,
298-
mut unwrapper: libc::uintptr_t, // either a UnwrapProto or 0
293+
mut unwrapper: int, // either a UnwrapProto or 0
299294
// FIXME(#3224) should be able to make this non-option to save memory, and
300295
// in unwrap() use "let ~ArcData { data: result, _ } = thing" to unwrap it
301296
mut data: Option<T>,
@@ -371,9 +366,9 @@ pub unsafe fn unwrap_shared_mutable_state<T: Send>(rc: SharedMutableState<T>)
371366
let (c1,p1) = pipes::oneshot(); // ()
372367
let (c2,p2) = pipes::oneshot(); // bool
373368
let server: UnwrapProto = ~mut Some((move c1,move p2));
374-
let serverp: libc::uintptr_t = cast::transmute(move server);
369+
let serverp: int = cast::transmute(move server);
375370
// Try to put our server end in the unwrapper slot.
376-
if rustrt::rust_compare_and_swap_ptr(&mut ptr.unwrapper, 0, serverp) {
371+
if compare_and_swap(&mut ptr.unwrapper, 0, serverp) {
377372
// Got in. Step 0: Tell destructor not to run. We are now it.
378373
rc.data = ptr::null();
379374
// Step 1 - drop our own reference.

0 commit comments

Comments
 (0)