File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
compio-runtime/src/runtime Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ use std::{
4
4
collections:: VecDeque ,
5
5
future:: { poll_fn, ready, Future } ,
6
6
io,
7
+ marker:: PhantomData ,
7
8
panic:: AssertUnwindSafe ,
9
+ rc:: Rc ,
8
10
sync:: Arc ,
9
11
task:: { Context , Poll } ,
10
12
time:: Duration ,
@@ -41,6 +43,9 @@ pub struct Runtime {
41
43
sync_runnables : Arc < SegQueue < Runnable > > ,
42
44
#[ cfg( feature = "time" ) ]
43
45
timer_runtime : RefCell < TimerRuntime > ,
46
+ // Other fields don't make it !Send, but actually `local_runnables` implies it should be !Send,
47
+ // otherwise it won't be valid if the runtime is sent to other threads.
48
+ _p : PhantomData < Rc < VecDeque < Runnable > > > ,
44
49
}
45
50
46
51
impl Runtime {
@@ -61,6 +66,7 @@ impl Runtime {
61
66
sync_runnables : Arc :: new ( SegQueue :: new ( ) ) ,
62
67
#[ cfg( feature = "time" ) ]
63
68
timer_runtime : RefCell :: new ( TimerRuntime :: new ( ) ) ,
69
+ _p : PhantomData ,
64
70
} )
65
71
}
66
72
You can’t perform that action at this time.
0 commit comments