std: Make os::set_exit_status work with newsched

This commit is contained in:
Brian Anderson
2013-07-09 13:29:05 -07:00
parent ec6d4a1733
commit 07e52eb7fc
5 changed files with 57 additions and 3 deletions

View File

@@ -960,6 +960,21 @@ 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;
}
//
// Local Variables:
// mode: C++