Linux Kernel
3.7.1
|
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/spinlock.h>
#include <linux/ftrace.h>
Go to the source code of this file.
Data Structures | |
struct | semaphore_waiter |
down - acquire the semaphore : the semaphore to be acquired
Acquires the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep until the semaphore is released.
Use of this function is deprecated, please use down_interruptible() or down_killable() instead.
Definition at line 53 of file semaphore.c.
down_interruptible - acquire the semaphore unless interrupted : the semaphore to be acquired
Attempts to acquire the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep. If the sleep is interrupted by a signal, this function will return -EINTR. If the semaphore is successfully acquired, this function returns 0.
Definition at line 75 of file semaphore.c.
down_killable - acquire the semaphore unless killed : the semaphore to be acquired
Attempts to acquire the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep. If the sleep is interrupted by a fatal signal, this function will return -EINTR. If the semaphore is successfully acquired, this function returns 0.
Definition at line 101 of file semaphore.c.
down_timeout - acquire the semaphore within a specified time : the semaphore to be acquired : how long to wait before failing
Attempts to acquire the semaphore. If no more tasks are allowed to acquire the semaphore, calling this function will put the task to sleep. If the semaphore is not released within the specified number of jiffies, this function returns -ETIME. It returns 0 if the semaphore was acquired.
Definition at line 155 of file semaphore.c.
down_trylock - try to acquire the semaphore, without waiting : the semaphore to be acquired
Try to acquire the semaphore atomically. Returns 0 if the semaphore has been acquired successfully or 1 if it it cannot be acquired.
NOTE: This return value is inverted from both spin_trylock and mutex_trylock! Be careful about this when converting code.
Unlike mutex_trylock, this function can be used from interrupt context, and the semaphore can be released by any task or interrupt.
Definition at line 130 of file semaphore.c.
EXPORT_SYMBOL | ( | down | ) |
EXPORT_SYMBOL | ( | down_interruptible | ) |
EXPORT_SYMBOL | ( | down_killable | ) |
EXPORT_SYMBOL | ( | down_trylock | ) |
EXPORT_SYMBOL | ( | down_timeout | ) |
EXPORT_SYMBOL | ( | up | ) |