chore: reuse is_worker function

main
Sean McBride 4 years ago
parent e898d5ab69
commit 1b58f819a7

@ -142,14 +142,7 @@ static inline void
software_interrupt_validate_worker() software_interrupt_validate_worker()
{ {
#ifndef NDEBUG #ifndef NDEBUG
bool is_worker = false; if (!runtime_is_worker()) panic("A non-worker thread received has unexpectedly received a signal!");
for (int i = 0; i < runtime_total_worker_processors; i++) {
if (pthread_self() == runtime_worker_threads[i]) {
is_worker = true;
break;
}
}
if (!is_worker) panic("A non-worker thread received has unexpectedly received a signal!");
#endif #endif
} }

Loading…
Cancel
Save