File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -133,19 +133,6 @@ impl Runtime {
133133 }
134134 Ok ( false )
135135 }
136-
137- fn poll ( & self ) -> io:: Result < bool > {
138- let mut sched = self . sched . lock ( ) . unwrap ( ) ;
139- sched. polling = true ;
140- drop ( sched) ;
141-
142- let result = self . reactor . poll ( None ) ;
143-
144- let mut sched = self . sched . lock ( ) . unwrap ( ) ;
145- sched. polling = false ;
146-
147- result
148- }
149136}
150137
151138/// A thread running a processor.
@@ -270,7 +257,20 @@ impl Machine {
270257 continue ;
271258 }
272259
273- rt. poll ( ) . unwrap ( ) ;
260+ let mut sched = rt. sched . lock ( ) . unwrap ( ) ;
261+
262+ if sched. polling {
263+ thread:: sleep ( Duration :: from_micros ( 10 ) ) ;
264+ continue ;
265+ }
266+
267+ sched. polling = true ;
268+ drop ( sched) ;
269+
270+ rt. reactor . poll ( None ) . unwrap ( ) ;
271+
272+ let mut sched = rt. sched . lock ( ) . unwrap ( ) ;
273+ sched. polling = false ;
274274
275275 runs = 0 ;
276276 fails = 0 ;
You can’t perform that action at this time.
0 commit comments