Runtime removal: refactor process

This patch continues the runtime removal by moving and refactoring the
process implementation into the new `sys` module.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.
This commit is contained in:
Aaron Turon
2014-10-09 16:27:28 -07:00
parent 3d195482a4
commit 0f98e75b69
10 changed files with 1250 additions and 176 deletions

View File

@@ -20,8 +20,6 @@
//! can be created in the future and there must be no active timers at that
//! time.
#![macro_escape]
use mem;
use rt::bookkeeping;
use rt::mutex::StaticNativeMutex;
@@ -57,15 +55,6 @@ pub struct Helper<M> {
pub initialized: UnsafeCell<bool>,
}
macro_rules! helper_init( (static $name:ident: Helper<$m:ty>) => (
static $name: Helper<$m> = Helper {
lock: ::std::rt::mutex::NATIVE_MUTEX_INIT,
chan: ::std::cell::UnsafeCell { value: 0 as *mut Sender<$m> },
signal: ::std::cell::UnsafeCell { value: 0 },
initialized: ::std::cell::UnsafeCell { value: false },
};
) )
impl<M: Send> Helper<M> {
/// Lazily boots a helper thread, becoming a no-op if the helper has already
/// been spawned.