File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ mod task_queue {
28
28
}
29
29
30
30
pub ( super ) struct Task {
31
- p : Box < dyn FnOnce ( ) > ,
31
+ p : Box < dyn FnOnce ( ) + Send > ,
32
32
done : JoinNotifier ,
33
33
}
34
34
35
35
unsafe impl Send for Task { }
36
36
37
37
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 ) {
39
39
let ( done, recv) = wait_notify:: new ( ) ;
40
40
let done = JoinNotifier ( Some ( done) ) ;
41
41
( Task { p, done } , recv)
@@ -97,7 +97,7 @@ pub mod wait_notify {
97
97
98
98
impl Thread {
99
99
// 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 > {
101
101
let mut queue_lock = task_queue:: lock ( ) ;
102
102
unsafe { usercalls:: launch_thread ( ) ? } ;
103
103
let ( task, handle) = task_queue:: Task :: new ( p) ;
You can’t perform that action at this time.
0 commit comments