Avoid manipulating semu_list outside of the scope of SEMUNDO_LOCK(). This

would lead to an occasional hang with a cycle in semu_list.

X-Discussed-On: hackers@
This commit is contained in:
Ed Maste 2007-03-26 17:41:14 +00:00
parent 7aa963e5e5
commit caa8943810

View File

@ -1287,8 +1287,10 @@ semexit_myhook(arg, p)
*/ */
SEMUNDO_LOCK(); SEMUNDO_LOCK();
SLIST_FOREACH_PREVPTR(suptr, supptr, &semu_list, un_next) { SLIST_FOREACH_PREVPTR(suptr, supptr, &semu_list, un_next) {
if (suptr->un_proc == p) if (suptr->un_proc == p) {
*supptr = SLIST_NEXT(suptr, un_next);
break; break;
}
} }
SEMUNDO_UNLOCK(); SEMUNDO_UNLOCK();
@ -1348,8 +1350,9 @@ semexit_myhook(arg, p)
* Deallocate the undo vector. * Deallocate the undo vector.
*/ */
DPRINTF(("removing vector\n")); DPRINTF(("removing vector\n"));
SEMUNDO_LOCK();
suptr->un_proc = NULL; suptr->un_proc = NULL;
*supptr = SLIST_NEXT(suptr, un_next); SEMUNDO_UNLOCK();
} }
static int static int