@@ -79,7 +79,7 @@ pub struct Scheduler {
79
79
/// A fast XorShift rng for scheduler use
80
80
rng : XorShiftRng ,
81
81
/// A togglable idle callback
82
- idle_callback : Option < ~PausableIdleCallback > ,
82
+ idle_callback : Option < ~PausableIdleCallback : Send > ,
83
83
/// A countdown that starts at a random value and is decremented
84
84
/// every time a yield check is performed. When it hits 0 a task
85
85
/// will yield.
@@ -99,7 +99,7 @@ pub struct Scheduler {
99
99
// destroyed before it's actually destroyed.
100
100
101
101
/// The event loop used to drive the scheduler and perform I/O
102
- event_loop : ~EventLoop ,
102
+ event_loop : ~EventLoop : Send ,
103
103
}
104
104
105
105
/// An indication of how hard to work on a given operation, the difference
@@ -122,7 +122,7 @@ impl Scheduler {
122
122
// * Initialization Functions
123
123
124
124
pub fn new ( pool_id : uint ,
125
- event_loop : ~EventLoop ,
125
+ event_loop : ~EventLoop : Send ,
126
126
work_queue : deque:: Worker < ~GreenTask > ,
127
127
work_queues : ~[ deque:: Stealer < ~GreenTask > ] ,
128
128
sleeper_list : SleeperList ,
@@ -135,7 +135,7 @@ impl Scheduler {
135
135
}
136
136
137
137
pub fn new_special ( pool_id : uint ,
138
- event_loop : ~EventLoop ,
138
+ event_loop : ~EventLoop : Send ,
139
139
work_queue : deque:: Worker < ~GreenTask > ,
140
140
work_queues : ~[ deque:: Stealer < ~GreenTask > ] ,
141
141
sleeper_list : SleeperList ,
@@ -182,7 +182,7 @@ impl Scheduler {
182
182
pub fn bootstrap ( mut ~self ) {
183
183
184
184
// Build an Idle callback.
185
- let cb = ~SchedRunner as ~Callback ;
185
+ let cb = ~SchedRunner as ~Callback : Send ;
186
186
self . idle_callback = Some ( self . event_loop . pausable_idle_callback ( cb) ) ;
187
187
188
188
// Create a task for the scheduler with an empty context.
@@ -230,7 +230,7 @@ impl Scheduler {
230
230
// mutable reference to the event_loop to give it the "run"
231
231
// command.
232
232
unsafe {
233
- let event_loop: * mut ~EventLoop = & mut self . event_loop ;
233
+ let event_loop: * mut ~EventLoop : Send = & mut self . event_loop ;
234
234
// Our scheduler must be in the task before the event loop
235
235
// is started.
236
236
stask. put_with_sched ( self ) ;
@@ -868,7 +868,7 @@ impl Scheduler {
868
868
}
869
869
870
870
pub fn make_handle ( & mut self ) -> SchedHandle {
871
- let remote = self . event_loop . remote_callback ( ~SchedRunner as ~ Callback ) ;
871
+ let remote = self . event_loop . remote_callback ( ~SchedRunner ) ;
872
872
873
873
return SchedHandle {
874
874
remote : remote,
@@ -893,7 +893,7 @@ pub enum SchedMessage {
893
893
}
894
894
895
895
pub struct SchedHandle {
896
- priv remote : ~RemoteCallback ,
896
+ priv remote : ~RemoteCallback : Send ,
897
897
priv queue : msgq:: Producer < SchedMessage > ,
898
898
sched_id : uint
899
899
}
@@ -1007,7 +1007,6 @@ mod test {
1007
1007
1008
1008
use std:: comm;
1009
1009
use std:: task:: TaskOpts ;
1010
- use std:: rt:: Runtime ;
1011
1010
use std:: rt:: task:: Task ;
1012
1011
use std:: rt:: local:: Local ;
1013
1012
@@ -1034,7 +1033,7 @@ mod test {
1034
1033
match task. get ( ) . maybe_take_runtime :: < GreenTask > ( ) {
1035
1034
Some ( green) => {
1036
1035
let ret = green. sched . get_ref ( ) . sched_id ( ) ;
1037
- task. get ( ) . put_runtime ( green as ~ Runtime ) ;
1036
+ task. get ( ) . put_runtime ( green) ;
1038
1037
return ret;
1039
1038
}
1040
1039
None => fail ! ( )
0 commit comments