kernel: Only sanity-check interrupts in switch_sem_etc under KDEBUG.
"are_interrupts_enabled()" is a "relatively" expensive function, so avoiding it makes sense. This is the same way it's done elsewhere in sem.cpp, as well as for mutexes and condition variables also.
This commit is contained in:
parent
c61fa718f2
commit
1eededf17f
|
@ -763,11 +763,12 @@ switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count,
|
||||||
return B_OK;
|
return B_OK;
|
||||||
if (sSemsActive == false)
|
if (sSemsActive == false)
|
||||||
return B_NO_MORE_SEMS;
|
return B_NO_MORE_SEMS;
|
||||||
|
#if KDEBUG
|
||||||
if (!are_interrupts_enabled()) {
|
if (!are_interrupts_enabled()) {
|
||||||
panic("switch_sem_etc: called with interrupts disabled for sem "
|
panic("switch_sem_etc: called with interrupts disabled for sem "
|
||||||
"%" B_PRId32 "\n", id);
|
"%" B_PRId32 "\n", id);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (id < 0)
|
if (id < 0)
|
||||||
return B_BAD_SEM_ID;
|
return B_BAD_SEM_ID;
|
||||||
|
|
Loading…
Reference in New Issue