Skip to content

Commit 5963353

Browse files
committed
---
yaml --- r: 85735 b: refs/heads/dist-snap c: 4541c6c h: refs/heads/master i: 85733: 5c7f59a 85731: d7b044c 85727: ab81f06 v: v3
1 parent 976eaa6 commit 5963353

File tree

4 files changed

+6
-34
lines changed

4 files changed

+6
-34
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: b4ef59db2fdf3d2f2c239a03f60569196a8df44d
9+
refs/heads/dist-snap: 4541c6cfe3ee875020329f888c39ea75183b23d1
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/rt/util.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use libc;
1414
use option::{Some, None};
1515
use os;
1616
use str::StrSlice;
17+
use unstable::atomics::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
1718

1819
#[cfg(target_os="macos")]
1920
use unstable::running_on_valgrind;
@@ -129,24 +130,12 @@ memory and partly incapable of presentation to others.",
129130
}
130131
}
131132

132-
pub fn set_exit_status(code: int) {
133-
#[fixed_stack_segment]; #[inline(never)];
134-
unsafe {
135-
return rust_set_exit_status_newrt(code as libc::uintptr_t);
136-
}
133+
static mut EXIT_STATUS: AtomicInt = INIT_ATOMIC_INT;
137134

138-
extern {
139-
fn rust_set_exit_status_newrt(code: libc::uintptr_t);
140-
}
135+
pub fn set_exit_status(code: int) {
136+
unsafe { EXIT_STATUS.store(code, SeqCst) }
141137
}
142138

143139
pub fn get_exit_status() -> int {
144-
#[fixed_stack_segment]; #[inline(never)];
145-
unsafe {
146-
return rust_get_exit_status_newrt() as int;
147-
}
148-
149-
extern {
150-
fn rust_get_exit_status_newrt() -> libc::uintptr_t;
151-
}
140+
unsafe { EXIT_STATUS.load(SeqCst) }
152141
}

branches/dist-snap/src/rt/rust_builtin.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -653,21 +653,6 @@ rust_get_global_args_ptr() {
653653
return &global_args_ptr;
654654
}
655655

656-
static lock_and_signal exit_status_lock;
657-
static uintptr_t exit_status = 0;
658-
659-
extern "C" CDECL void
660-
rust_set_exit_status_newrt(uintptr_t code) {
661-
scoped_lock with(exit_status_lock);
662-
exit_status = code;
663-
}
664-
665-
extern "C" CDECL uintptr_t
666-
rust_get_exit_status_newrt() {
667-
scoped_lock with(exit_status_lock);
668-
return exit_status;
669-
}
670-
671656
static lock_and_signal change_dir_lock;
672657

673658
extern "C" CDECL void

branches/dist-snap/src/rt/rustrt.def.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ rust_get_num_cpus
191191
rust_get_global_args_ptr
192192
rust_take_global_args_lock
193193
rust_drop_global_args_lock
194-
rust_set_exit_status_newrt
195-
rust_get_exit_status_newrt
196194
rust_take_change_dir_lock
197195
rust_drop_change_dir_lock
198196
rust_get_test_int

0 commit comments

Comments
 (0)