File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -334,8 +334,6 @@ pub fn reschedule_threads(
334
334
}
335
335
336
336
pub fn init_threads ( cs : & mut CriticalSection ) {
337
- * CURRENT_THREAD . borrow ( cs) = THREADS . borrow ( cs) . as_mut_ptr ( ) ;
338
-
339
337
fn switch_threads ( ctxt : IRQCtxt ) -> * mut ThreadControlBlock {
340
338
reschedule_threads ( ctxt. tcb , ctxt. cs )
341
339
}
@@ -344,7 +342,8 @@ pub fn init_threads(cs: &mut CriticalSection) {
344
342
}
345
343
346
344
#[ no_mangle]
347
- pub static CURRENT_THREAD : Global < * mut ThreadControlBlock > = Global :: new ( ptr:: null_mut ( ) ) ;
345
+ pub static CURRENT_THREAD : Global < * mut ThreadControlBlock > =
346
+ Global :: new ( THREADS . as_ptr ( ) as * mut _ ) ;
348
347
349
348
static THREADS : Global < [ ThreadControlBlock ; 4 ] > = {
350
349
let mut tcbs = [ const { ThreadControlBlock :: new ( [ 0 ; 31 ] , [ 0 ; 3 ] ) } ; 4 ] ;
You can’t perform that action at this time.
0 commit comments