Skip to content

Commit a5cd502

Browse files
committed
auto merge of #13630 : alexcrichton/rust/correct-green-bounds, r=brson
These were mistakenly not updated as part of the removal of the Send bound by default on procedures. cc #13629
2 parents 7d725a3 + 97c91c9 commit a5cd502

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/libgreen/basic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ mod test {
243243
})
244244
}
245245

246-
fn run(f: proc()) {
246+
fn run(f: proc():Send) {
247247
let mut pool = pool();
248248
pool.spawn(TaskOpts::new(), f);
249249
pool.shutdown();

src/libgreen/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Context {
4646
/// FIXME: this is basically an awful the interface. The main reason for
4747
/// this is to reduce the number of allocations made when a green
4848
/// task is spawned as much as possible
49-
pub fn new(init: InitFn, arg: uint, start: proc(),
49+
pub fn new(init: InitFn, arg: uint, start: proc():Send,
5050
stack: &mut Stack) -> Context {
5151

5252
let sp: *uint = stack.end();

src/libgreen/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ macro_rules! green_start( ($f:ident) => (
289289
/// error.
290290
pub fn start(argc: int, argv: **u8,
291291
event_loop_factory: fn() -> ~rtio::EventLoop:Send,
292-
main: proc()) -> int {
292+
main: proc():Send) -> int {
293293
rt::init(argc, argv);
294294
let mut main = Some(main);
295295
let mut ret = None;
@@ -310,7 +310,7 @@ pub fn start(argc: int, argv: **u8,
310310
/// This function will not return until all schedulers in the associated pool
311311
/// have returned.
312312
pub fn run(event_loop_factory: fn() -> ~rtio::EventLoop:Send,
313-
main: proc()) -> int {
313+
main: proc():Send) -> int {
314314
// Create a scheduler pool and spawn the main task into this pool. We will
315315
// get notified over a channel when the main task exits.
316316
let mut cfg = PoolConfig::new();
@@ -445,7 +445,7 @@ impl SchedPool {
445445
/// This is useful to create a task which can then be sent to a specific
446446
/// scheduler created by `spawn_sched` (and possibly pin it to that
447447
/// scheduler).
448-
pub fn task(&mut self, opts: TaskOpts, f: proc()) -> ~GreenTask {
448+
pub fn task(&mut self, opts: TaskOpts, f: proc():Send) -> ~GreenTask {
449449
GreenTask::configure(&mut self.stack_pool, opts, f)
450450
}
451451

@@ -455,7 +455,7 @@ impl SchedPool {
455455
/// New tasks are spawned in a round-robin fashion to the schedulers in this
456456
/// pool, but tasks can certainly migrate among schedulers once they're in
457457
/// the pool.
458-
pub fn spawn(&mut self, opts: TaskOpts, f: proc()) {
458+
pub fn spawn(&mut self, opts: TaskOpts, f: proc():Send) {
459459
let task = self.task(opts, f);
460460

461461
// Figure out someone to send this task to

src/libgreen/sched.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ mod test {
10271027
})
10281028
}
10291029

1030-
fn run(f: proc()) {
1030+
fn run(f: proc():Send) {
10311031
let mut pool = pool();
10321032
pool.spawn(TaskOpts::new(), f);
10331033
pool.shutdown();

src/libgreen/simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl Runtime for SimpleTask {
7272
// feet and running.
7373
fn yield_now(~self, _cur_task: ~Task) { fail!() }
7474
fn maybe_yield(~self, _cur_task: ~Task) { fail!() }
75-
fn spawn_sibling(~self, _cur_task: ~Task, _opts: TaskOpts, _f: proc()) {
75+
fn spawn_sibling(~self, _cur_task: ~Task, _opts: TaskOpts, _f: proc():Send) {
7676
fail!()
7777
}
7878
fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>> { None }

src/libgreen/task.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ impl GreenTask {
129129
/// and will not have any contained Task structure.
130130
pub fn new(stack_pool: &mut StackPool,
131131
stack_size: Option<uint>,
132-
start: proc()) -> ~GreenTask {
132+
start: proc():Send) -> ~GreenTask {
133133
GreenTask::new_homed(stack_pool, stack_size, AnySched, start)
134134
}
135135

136136
/// Creates a new task (like `new`), but specifies the home for new task.
137137
pub fn new_homed(stack_pool: &mut StackPool,
138138
stack_size: Option<uint>,
139139
home: Home,
140-
start: proc()) -> ~GreenTask {
140+
start: proc():Send) -> ~GreenTask {
141141
// Allocate ourselves a GreenTask structure
142142
let mut ops = GreenTask::new_typed(None, TypeGreen(Some(home)));
143143

@@ -175,7 +175,7 @@ impl GreenTask {
175175
/// new stack for this task.
176176
pub fn configure(pool: &mut StackPool,
177177
opts: TaskOpts,
178-
f: proc()) -> ~GreenTask {
178+
f: proc():Send) -> ~GreenTask {
179179
let TaskOpts {
180180
notify_chan, name, stack_size,
181181
stderr, stdout,
@@ -443,7 +443,7 @@ impl Runtime for GreenTask {
443443
}
444444
}
445445

446-
fn spawn_sibling(mut ~self, cur_task: ~Task, opts: TaskOpts, f: proc()) {
446+
fn spawn_sibling(mut ~self, cur_task: ~Task, opts: TaskOpts, f: proc():Send) {
447447
self.put_task(cur_task);
448448

449449
// Spawns a task into the current scheduler. We allocate the new task's
@@ -490,7 +490,7 @@ mod tests {
490490
use super::super::{PoolConfig, SchedPool};
491491
use super::GreenTask;
492492

493-
fn spawn_opts(opts: TaskOpts, f: proc()) {
493+
fn spawn_opts(opts: TaskOpts, f: proc():Send) {
494494
let mut pool = SchedPool::new(PoolConfig {
495495
threads: 1,
496496
event_loop_factory: ::rustuv::event_loop,

0 commit comments

Comments
 (0)