| 426 | } |
| 427 | |
| 428 | void thread_mutex_lock(struct thread_mutex *mutex) |
| 429 | { |
| 430 | struct stopwatch sw; |
| 431 | |
| 432 | stopwatch_init(&sw); |
| 433 | |
| 434 | while (mutex->locked) |
| 435 | assert(thread_yield() == 0); |
| 436 | mutex->locked = true; |
| 437 | |
| 438 | printk(BIOS_SPEW, "took %lld us to acquire mutex\n", stopwatch_duration_usecs(&sw)); |
| 439 | } |
| 440 | |
| 441 | void thread_mutex_unlock(struct thread_mutex *mutex) |
| 442 | { |
no test coverage detected