aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/semaphore.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-09-08semaphore: Add DEFINE_SEMAPHOREThomas Gleixner1-0/+3
The full cleanup of init_MUTEX[_LOCKED] and DECLARE_MUTEX has not been done. Some of the users are real semaphores and we should name them as such instead of confusing everyone with "MUTEX". Provide the infrastructure to get finally rid of init_MUTEX[_LOCKED] and DECLARE_MUTEX. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> LKML-Reference: <20100907125054.795929962@linutronix.de>
2008-07-24Remove __DECLARE_SEMAPHORE_GENERICMatthew Wilcox1-4/+2
There are no users of __DECLARE_SEMAPHORE_GENERIC in the kernel Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17Improve semaphore documentationMatthew Wilcox1-37/+2
Move documentation from semaphore.h to semaphore.c as requested by Andrew Morton. Also reformat to kernel-doc style and add some more notes about the implementation. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17Simplify semaphore implementationMatthew Wilcox1-6/+3
By removing the negative values of 'count' and relying on the wait_list to indicate whether we have any waiters, we can simplify the implementation by removing the protection against an unlikely race condition. Thanks to David Howells for his suggestions. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17Add down_timeout and change ACPI to use itMatthew Wilcox1-0/+6
ACPI currently emulates a timeout for semaphores with calls to down_trylock and sleep. This produces horrible behaviour in terms of fairness and excessive wakeups. Now that we have a unified semaphore implementation, adding a real down_trylock is almost trivial. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17Introduce down_killable()Matthew Wilcox1-0/+6
down_killable() is the functional counterpart of mutex_lock_killable. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-17Generic semaphore implementationMatthew Wilcox1-0/+77
Semaphores are no longer performance-critical, so a generic C implementation is better for maintainability, debuggability and extensibility. Thanks to Peter Zijlstra for fixing the lockdep warning. Thanks to Harvey Harrison for pointing out that the unlikely() was unnecessary. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Ingo Molnar <mingo@elte.hu>