• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/kernel/

Lines Matching refs:semaphore

8  * A counting semaphore may be acquired 'n' times before sleeping.
16 * The spinlock controls access to the other members of the semaphore.
19 * parts of the kernel expect to be able to use down() on a semaphore in
25 * semaphore. If it's zero, there may be tasks waiting on the wait_list.
32 #include <linux/semaphore.h>
36 static noinline void __down(struct semaphore *sem);
37 static noinline int __down_interruptible(struct semaphore *sem);
38 static noinline int __down_killable(struct semaphore *sem);
39 static noinline int __down_timeout(struct semaphore *sem, long jiffies);
40 static noinline void __up(struct semaphore *sem);
43 * down - acquire the semaphore
44 * @sem: the semaphore to be acquired
46 * Acquires the semaphore. If no more tasks are allowed to acquire the
47 * semaphore, calling this function will put the task to sleep until the
48 * semaphore is released.
53 void down(struct semaphore *sem)
67 * down_interruptible - acquire the semaphore unless interrupted
68 * @sem: the semaphore to be acquired
70 * Attempts to acquire the semaphore. If no more tasks are allowed to
71 * acquire the semaphore, calling this function will put the task to sleep.
73 * If the semaphore is successfully acquired, this function returns 0.
75 int down_interruptible(struct semaphore *sem)
92 * down_killable - acquire the semaphore unless killed
93 * @sem: the semaphore to be acquired
95 * Attempts to acquire the semaphore. If no more tasks are allowed to
96 * acquire the semaphore, calling this function will put the task to sleep.
98 * -EINTR. If the semaphore is successfully acquired, this function returns
101 int down_killable(struct semaphore *sem)
118 * down_trylock - try to acquire the semaphore, without waiting
119 * @sem: the semaphore to be acquired
121 * Try to acquire the semaphore atomically. Returns 0 if the mutex has
128 * and the semaphore can be released by any task or interrupt.
130 int down_trylock(struct semaphore *sem)
146 * down_timeout - acquire the semaphore within a specified time
147 * @sem: the semaphore to be acquired
150 * Attempts to acquire the semaphore. If no more tasks are allowed to
151 * acquire the semaphore, calling this function will put the task to sleep.
152 * If the semaphore is not released within the specified number of jiffies,
153 * this function returns -ETIME. It returns 0 if the semaphore was acquired.
155 int down_timeout(struct semaphore *sem, long jiffies)
172 * up - release the semaphore
173 * @sem: the semaphore to release
175 * Release the semaphore. Unlike mutexes, up() may be called from any
178 void up(struct semaphore *sem)
204 static inline int __sched __down_common(struct semaphore *sem, long state,
236 static noinline void __sched __down(struct semaphore *sem)
241 static noinline int __sched __down_interruptible(struct semaphore *sem)
246 static noinline int __sched __down_killable(struct semaphore *sem)
251 static noinline int __sched __down_timeout(struct semaphore *sem, long jiffies)
256 static noinline void __sched __up(struct semaphore *sem)