* bsd_mutex.cc (_msleep): Reset event object and close it before
entering mutex. Turn order of conditional for better readability.
This commit is contained in:
@ -222,10 +222,12 @@ _msleep (void *ident, struct mtx *mtx, int priority,
|
||||
panic ("wait in msleep (%s) failed, %E", wmesg);
|
||||
break;
|
||||
}
|
||||
set_priority (old_priority);
|
||||
if (!(priority & PDROP) && mtx)
|
||||
mtx_lock (mtx);
|
||||
/* Dismiss event before entering mutex. */
|
||||
ResetEvent (evt);
|
||||
CloseHandle (evt);
|
||||
set_priority (old_priority);
|
||||
if (mtx && !(priority & PDROP))
|
||||
mtx_lock (mtx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user