rt: Remove exit_status helpers
This commit is contained in:
parent
b4ef59db2f
commit
4541c6cfe3
@ -14,6 +14,7 @@ use libc;
|
||||
use option::{Some, None};
|
||||
use os;
|
||||
use str::StrSlice;
|
||||
use unstable::atomics::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
use unstable::running_on_valgrind;
|
||||
@ -129,24 +130,12 @@ memory and partly incapable of presentation to others.",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_exit_status(code: int) {
|
||||
#[fixed_stack_segment]; #[inline(never)];
|
||||
unsafe {
|
||||
return rust_set_exit_status_newrt(code as libc::uintptr_t);
|
||||
}
|
||||
static mut EXIT_STATUS: AtomicInt = INIT_ATOMIC_INT;
|
||||
|
||||
extern {
|
||||
fn rust_set_exit_status_newrt(code: libc::uintptr_t);
|
||||
}
|
||||
pub fn set_exit_status(code: int) {
|
||||
unsafe { EXIT_STATUS.store(code, SeqCst) }
|
||||
}
|
||||
|
||||
pub fn get_exit_status() -> int {
|
||||
#[fixed_stack_segment]; #[inline(never)];
|
||||
unsafe {
|
||||
return rust_get_exit_status_newrt() as int;
|
||||
}
|
||||
|
||||
extern {
|
||||
fn rust_get_exit_status_newrt() -> libc::uintptr_t;
|
||||
}
|
||||
unsafe { EXIT_STATUS.load(SeqCst) }
|
||||
}
|
||||
|
@ -653,21 +653,6 @@ rust_get_global_args_ptr() {
|
||||
return &global_args_ptr;
|
||||
}
|
||||
|
||||
static lock_and_signal exit_status_lock;
|
||||
static uintptr_t exit_status = 0;
|
||||
|
||||
extern "C" CDECL void
|
||||
rust_set_exit_status_newrt(uintptr_t code) {
|
||||
scoped_lock with(exit_status_lock);
|
||||
exit_status = code;
|
||||
}
|
||||
|
||||
extern "C" CDECL uintptr_t
|
||||
rust_get_exit_status_newrt() {
|
||||
scoped_lock with(exit_status_lock);
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static lock_and_signal change_dir_lock;
|
||||
|
||||
extern "C" CDECL void
|
||||
|
@ -191,8 +191,6 @@ rust_get_num_cpus
|
||||
rust_get_global_args_ptr
|
||||
rust_take_global_args_lock
|
||||
rust_drop_global_args_lock
|
||||
rust_set_exit_status_newrt
|
||||
rust_get_exit_status_newrt
|
||||
rust_take_change_dir_lock
|
||||
rust_drop_change_dir_lock
|
||||
rust_get_test_int
|
||||
|
Loading…
Reference in New Issue
Block a user