diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-10-13 20:44:35 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-20 18:23:47 -0700 |
| commit | e0bba33caaeeda99753ec0355d570665f9912d03 (patch) | |
| tree | 256d015519ee21f88d8c0028f0d20b7f20fd29f8 /src/lib | |
| parent | 446aea11d0dcb668c796c666dcb48dd89e69fbc7 (diff) | |
| download | rust-e0bba33caaeeda99753ec0355d570665f9912d03.tar.gz rust-e0bba33caaeeda99753ec0355d570665f9912d03.zip | |
Rename std::task::spawn_inner to unsafe_spawn_inner
Delete the rest of the old, unused spawn functions. Issue #1022
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/task.rs | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/lib/task.rs b/src/lib/task.rs index 8b9b6da5dec..a0c1e37aff1 100644 --- a/src/lib/task.rs +++ b/src/lib/task.rs @@ -131,23 +131,13 @@ fn spawn_inner2<~T>(-data: T, f: fn#(T), let dataptr: *u8 = unsafe::reinterpret_cast(data); unsafe::leak(data); let wrapped = bind wrapper(dataptr, f); - ret spawn_inner(wrapped, notify); + ret unsafe_spawn_inner(wrapped, notify); } -fn spawn(-thunk: fn()) -> task { spawn_inner(thunk, none) } - -fn spawn_notify(-thunk: fn(), notify: comm::chan<task_notification>) -> task { - spawn_inner(thunk, some(notify)) -} - -fn spawn_joinable(-thunk: fn()) -> joinable_task { - let p = comm::port::<task_notification>(); - let id = spawn_notify(thunk, comm::chan::<task_notification>(p)); - ret (id, p); -} - -// FIXME: make this a fn~ once those are supported. -fn spawn_inner(-thunk: fn(), notify: option<comm::chan<task_notification>>) -> +// FIXME: This is the old spawn function that spawns a shared closure. +// It is a hack and needs to be rewritten. +fn unsafe_spawn_inner(-thunk: fn(), + notify: option<comm::chan<task_notification>>) -> task_id unsafe { let id = rustrt::new_task(); |
