Skip to content

Commit 8765497

Browse files
committed
---
yaml --- r: 37476 b: refs/heads/try c: 563aa0b h: refs/heads/master v: v3
1 parent 3a0fb08 commit 8765497

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: a0066082764456d642e25ae9ae780e1952cf1b94
5+
refs/heads/try: 563aa0bf6c932b2150557b335f9a40675639c323
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/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)