diff options
author | Matthew Wilcox <matthew@wil.cx> | 2008-03-14 13:43:13 -0400 |
---|---|---|
committer | Matthew Wilcox <willy@linux.intel.com> | 2008-04-17 10:42:46 -0400 |
commit | f1241c87a16c4fe9f4f51d6ed3589f031c505e8d (patch) | |
tree | 2e0ee0f2b864c89eda9067bda0d8a98596e022e7 /include/linux/semaphore.h | |
parent | f06d96865861c3dd01520f47e2e61c899db1631f (diff) |
Add down_timeout and change ACPI to use it
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>
Diffstat (limited to 'include/linux/semaphore.h')
-rw-r--r-- | include/linux/semaphore.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h index 88f2a28cc0f1..a107aebd9148 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h | |||
@@ -75,6 +75,12 @@ extern int __must_check down_killable(struct semaphore *sem); | |||
75 | extern int __must_check down_trylock(struct semaphore *sem); | 75 | extern int __must_check down_trylock(struct semaphore *sem); |
76 | 76 | ||
77 | /* | 77 | /* |
78 | * As down(), except this function will return -ETIME if it fails to | ||
79 | * acquire the semaphore within the specified number of jiffies. | ||
80 | */ | ||
81 | extern int __must_check down_timeout(struct semaphore *sem, long jiffies); | ||
82 | |||
83 | /* | ||
78 | * Release the semaphore. Unlike mutexes, up() may be called from any | 84 | * Release the semaphore. Unlike mutexes, up() may be called from any |
79 | * context and even by tasks which have never called down(). | 85 | * context and even by tasks which have never called down(). |
80 | */ | 86 | */ |