Thanks to Haobo Xu for pointing this out.
This function may sleep, so it must not be called within an
interrupt handler. This function may be called with
This function may sleep, so it must not be called within an
interrupt handler. This function may be called with
- interrupts disabled, but interrupts will be turned back on if
- we need to sleep. */
+ interrupts disabled, but if it sleeps then the next scheduled
+ thread will probably turn interrupts back on. */
void
sema_down (struct semaphore *sema)
{
void
sema_down (struct semaphore *sema)
{