Lines Matching refs:semaphore

7  * A counting semaphore may be acquired 'n' times before sleeping.
15 * The spinlock controls access to the other members of the semaphore.
18 * parts of the kernel expect to be able to use down() on a semaphore in
24 * semaphore. If it's zero, there may be tasks waiting on the wait_list.
32 #include <linux/semaphore.h>
37 static noinline void __down(struct semaphore *sem);
38 static noinline int __down_interruptible(struct semaphore *sem);
39 static noinline int __down_killable(struct semaphore *sem);
40 static noinline int __down_timeout(struct semaphore *sem, long timeout);
41 static noinline void __up(struct semaphore *sem);
44 * down - acquire the semaphore
45 * @sem: the semaphore to be acquired
47 * Acquires the semaphore. If no more tasks are allowed to acquire the
48 * semaphore, calling this function will put the task to sleep until the
49 * semaphore is released.
54 void __sched down(struct semaphore *sem)
69 * down_interruptible - acquire the semaphore unless interrupted
70 * @sem: the semaphore to be acquired
72 * Attempts to acquire the semaphore. If no more tasks are allowed to
73 * acquire the semaphore, calling this function will put the task to sleep.
75 * If the semaphore is successfully acquired, this function returns 0.
77 int __sched down_interruptible(struct semaphore *sem)
95 * down_killable - acquire the semaphore unless killed
96 * @sem: the semaphore to be acquired
98 * Attempts to acquire the semaphore. If no more tasks are allowed to
99 * acquire the semaphore, calling this function will put the task to sleep.
101 * -EINTR. If the semaphore is successfully acquired, this function returns
104 int __sched down_killable(struct semaphore *sem)
122 * down_trylock - try to acquire the semaphore, without waiting
123 * @sem: the semaphore to be acquired
125 * Try to acquire the semaphore atomically. Returns 0 if the semaphore has
132 * and the semaphore can be released by any task or interrupt.
134 int __sched down_trylock(struct semaphore *sem)
150 * down_timeout - acquire the semaphore within a specified time
151 * @sem: the semaphore to be acquired
154 * Attempts to acquire the semaphore. If no more tasks are allowed to
155 * acquire the semaphore, calling this function will put the task to sleep.
156 * If the semaphore is not released within the specified number of jiffies,
157 * this function returns -ETIME. It returns 0 if the semaphore was acquired.
159 int __sched down_timeout(struct semaphore *sem, long timeout)
177 * up - release the semaphore
178 * @sem: the semaphore to release
180 * Release the semaphore. Unlike mutexes, up() may be called from any
183 void __sched up(struct semaphore *sem)
209 static inline int __sched ___down_common(struct semaphore *sem, long state,
240 static inline int __sched __down_common(struct semaphore *sem, long state,
252 static noinline void __sched __down(struct semaphore *sem)
257 static noinline int __sched __down_interruptible(struct semaphore *sem)
262 static noinline int __sched __down_killable(struct semaphore *sem)
267 static noinline int __sched __down_timeout(struct semaphore *sem, long timeout)
272 static noinline void __sched __up(struct semaphore *sem)