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 {
133
133
}
134
134
Ok ( false )
135
135
}
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
- }
149
136
}
150
137
151
138
/// A thread running a processor.
@@ -270,7 +257,20 @@ impl Machine {
270
257
continue ;
271
258
}
272
259
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 ;
274
274
275
275
runs = 0 ;
276
276
fails = 0 ;
You can’t perform that action at this time.
0 commit comments