Makes the given thread the current thread If another thread was running schedule it
(thread: Box<Thread>)
| 334 | /// Makes the given thread the current thread |
| 335 | /// If another thread was running schedule it |
| 336 | pub fn set_current_thread(thread: Box<Thread>) { |
| 337 | // Replace the current thread |
| 338 | let old_current = CURRENT_THREAD.write().replace(thread); |
| 339 | if let Some(t) = old_current { |
| 340 | schedule_thread(t); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | /// Start a new kernel thread by adding it to the process table. |
| 345 | /// This won't run immediately, but will run when the scheduler |
no test coverage detected