File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ mod task_queue {
2828 }
2929
3030 pub ( super ) struct Task {
31- p : Box < dyn FnOnce ( ) > ,
31+ p : Box < dyn FnOnce ( ) + Send > ,
3232 done : JoinNotifier ,
3333 }
3434
3535 unsafe impl Send for Task { }
3636
3737 impl Task {
38- pub ( super ) fn new ( p : Box < dyn FnOnce ( ) > ) -> ( Task , JoinHandle ) {
38+ pub ( super ) fn new ( p : Box < dyn FnOnce ( ) + Send > ) -> ( Task , JoinHandle ) {
3939 let ( done, recv) = wait_notify:: new ( ) ;
4040 let done = JoinNotifier ( Some ( done) ) ;
4141 ( Task { p, done } , recv)
@@ -97,7 +97,7 @@ pub mod wait_notify {
9797
9898impl Thread {
9999 // unsafe: see thread::Builder::spawn_unchecked for safety requirements
100- pub unsafe fn new ( _stack : usize , p : Box < dyn FnOnce ( ) > ) -> io:: Result < Thread > {
100+ pub unsafe fn new ( _stack : usize , p : Box < dyn FnOnce ( ) + Send > ) -> io:: Result < Thread > {
101101 let mut queue_lock = task_queue:: lock ( ) ;
102102 unsafe { usercalls:: launch_thread ( ) ? } ;
103103 let ( task, handle) = task_queue:: Task :: new ( p) ;
You can’t perform that action at this time.
0 commit comments