From 956cdd1b90acdc646bd4c7d3066539859f8b0f62 Mon Sep 17 00:00:00 2001 From: Manfred Spraul Date: Tue, 4 Jan 2005 05:34:13 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sem.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') 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 -- cgit v1.2.3