Skip to content

Commit 4610ef4

Browse files
committed
---
yaml --- r: 5872 b: refs/heads/master c: e0bba33 h: refs/heads/master v: v3
1 parent 4b3f7ec commit 4610ef4

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 446aea11d0dcb668c796c666dcb48dd89e69fbc7
2+
refs/heads/master: e0bba33caaeeda99753ec0355d570665f9912d03

trunk/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)