Skip to content

Commit e0bba33

Browse files
committed
Rename std::task::spawn_inner to unsafe_spawn_inner
Delete the rest of the old, unused spawn functions. Issue #1022
1 parent 446aea1 commit e0bba33

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/lib/task.rs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,13 @@ fn spawn_inner2<~T>(-data: T, f: fn#(T),
131131
let dataptr: *u8 = unsafe::reinterpret_cast(data);
132132
unsafe::leak(data);
133133
let wrapped = bind wrapper(dataptr, f);
134-
ret spawn_inner(wrapped, notify);
134+
ret unsafe_spawn_inner(wrapped, notify);
135135
}
136136

137-
fn spawn(-thunk: fn()) -> task { spawn_inner(thunk, none) }
138-
139-
fn spawn_notify(-thunk: fn(), notify: comm::chan<task_notification>) -> task {
140-
spawn_inner(thunk, some(notify))
141-
}
142-
143-
fn spawn_joinable(-thunk: fn()) -> joinable_task {
144-
let p = comm::port::<task_notification>();
145-
let id = spawn_notify(thunk, comm::chan::<task_notification>(p));
146-
ret (id, p);
147-
}
148-
149-
// FIXME: make this a fn~ once those are supported.
150-
fn spawn_inner(-thunk: fn(), notify: option<comm::chan<task_notification>>) ->
137+
// FIXME: This is the old spawn function that spawns a shared closure.
138+
// It is a hack and needs to be rewritten.
139+
fn unsafe_spawn_inner(-thunk: fn(),
140+
notify: option<comm::chan<task_notification>>) ->
151141
task_id unsafe {
152142
let id = rustrt::new_task();
153143

0 commit comments

Comments
 (0)