diff options
| author | Manfred Spraul <manfred@colorfullife.com> | 2005-01-04 05:34:13 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:34:13 -0800 |
| commit | 956cdd1b90acdc646bd4c7d3066539859f8b0f62 (patch) | |
| tree | 5dafde81da9f18ce6fc60743fbf19b38b0161a4f /include/linux | |
| parent | 79a35a448eed5cc795f32625946b38a8a5f595ea (diff) | |
[PATCH] fix missing wakeup in ipc/sem
My patch that removed the spin_lock calls from the tail of sys_semtimedop
introduced a bug:
Before my patch was merged, every operation that altered an array called
update_queue. That call woke up threads that were waiting until a
semaphore value becomes 0. I've accidentially removed that call.
The attached patch fixes that by modifying update_queue: the function now
loops internally and wakes up all threads. The patch also removes
update_queue calls from the error path of sys_semtimedop: failed operations
do not modify the array, no need to rescan the list of waiting threads.
Signed-Off-By: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sem.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sem.h b/include/linux/sem.h index c365f7989928..2d8516be9fd7 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -109,6 +109,7 @@ struct sem_queue { int id; /* internal sem id */ struct sembuf * sops; /* array of pending operations */ int nsops; /* number of operations */ + int alter; /* does the operation alter the array? */ }; /* Each task has a list of undo requests. They are executed automatically |
