From 1b58f819a7f9b58a23f83cfade210f30e2b65e2a Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 29 Jul 2020 20:52:32 -0400 Subject: [PATCH] chore: reuse is_worker function --- runtime/src/software_interrupt.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/runtime/src/software_interrupt.c b/runtime/src/software_interrupt.c index 63361cd..b47de31 100644 --- a/runtime/src/software_interrupt.c +++ b/runtime/src/software_interrupt.c @@ -142,14 +142,7 @@ static inline void software_interrupt_validate_worker() { #ifndef NDEBUG - bool is_worker = false; - 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!"); + if (!runtime_is_worker()) panic("A non-worker thread received has unexpectedly received a signal!"); #endif }