Fix thinko in previous commit.
This commit is contained in:
parent
861c8760a3
commit
69f600c8a2
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: sysv_sem.c,v 1.15 1994/12/05 07:32:24 mycroft Exp $ */
|
/* $NetBSD: sysv_sem.c,v 1.16 1994/12/05 07:54:48 mycroft Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation of SVID semaphores
|
* Implementation of SVID semaphores
|
||||||
@ -827,17 +827,6 @@ semexit(p)
|
|||||||
register struct sem_undo *suptr;
|
register struct sem_undo *suptr;
|
||||||
register struct sem_undo **supptr;
|
register struct sem_undo **supptr;
|
||||||
|
|
||||||
/*
|
|
||||||
* Go through the chain of undo vectors looking for one
|
|
||||||
* associated with this process.
|
|
||||||
*/
|
|
||||||
|
|
||||||
for (supptr = &semu_list; (suptr = *supptr) != NULL;
|
|
||||||
supptr = &suptr->un_next) {
|
|
||||||
if (suptr->un_proc == p)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There are a few possibilities to consider here ...
|
* There are a few possibilities to consider here ...
|
||||||
*
|
*
|
||||||
@ -878,6 +867,17 @@ semexit(p)
|
|||||||
/*
|
/*
|
||||||
* Yes (i.e. we are in case 3 or 4).
|
* Yes (i.e. we are in case 3 or 4).
|
||||||
*
|
*
|
||||||
|
* Go through the chain of undo vectors looking for one
|
||||||
|
* associated with this process.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (supptr = &semu_list; (suptr = *supptr) != NULL;
|
||||||
|
supptr = &suptr->un_next) {
|
||||||
|
if (suptr->un_proc == p)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
* If we didn't find an undo vector associated with this
|
* If we didn't find an undo vector associated with this
|
||||||
* process than we can just return (i.e. we are in case 3).
|
* process than we can just return (i.e. we are in case 3).
|
||||||
*
|
*
|
||||||
@ -903,24 +903,33 @@ semexit(p)
|
|||||||
* Nobody is holding the facility (i.e. we are now in case 1).
|
* Nobody is holding the facility (i.e. we are now in case 1).
|
||||||
* We can proceed safely according to the argument outlined
|
* We can proceed safely according to the argument outlined
|
||||||
* above.
|
* above.
|
||||||
*/
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* No (i.e. we are in case 1 or 2).
|
|
||||||
*
|
*
|
||||||
* If there is no undo vector, skip to the end and unlock the
|
* We look up the undo vector again, in case the list changed
|
||||||
* semaphore facility if necessary.
|
* while we were asleep.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (suptr == NULL)
|
|
||||||
goto unlock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are now in case 1 or 2, and we have an undo vector for this
|
* We are now in case 1 or 2.
|
||||||
* process.
|
*
|
||||||
|
* Go through the chain of undo vectors looking for one associated with
|
||||||
|
* this process.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
for (supptr = &semu_list; (suptr = *supptr) != NULL;
|
||||||
|
supptr = &suptr->un_next) {
|
||||||
|
if (suptr->un_proc == p)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there is no undo vector, skip to the end and unlock the semaphore
|
||||||
|
* facility if necessary.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (suptr == NULL)
|
||||||
|
goto unlock;
|
||||||
|
|
||||||
#ifdef SEM_DEBUG
|
#ifdef SEM_DEBUG
|
||||||
printf("proc @%08x has undo structure with %d entries\n", p,
|
printf("proc @%08x has undo structure with %d entries\n", p,
|
||||||
suptr->un_cnt);
|
suptr->un_cnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user