Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
rtmutex.h File Reference
#include <linux/linkage.h>
#include <linux/plist.h>
#include <linux/spinlock_types.h>

Go to the source code of this file.

Data Structures

struct  rt_mutex
 

Macros

#define rt_mutex_debug_check_no_locks_held(task)   do { } while (0)
 
#define __DEBUG_RT_MUTEX_INITIALIZER(mutexname)
 
#define rt_mutex_init(mutex)   __rt_mutex_init(mutex, NULL)
 
#define rt_mutex_debug_task_free(t)   do { } while (0)
 
#define __RT_MUTEX_INITIALIZER(mutexname)
 
#define DEFINE_RT_MUTEX(mutexname)   struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
 
#define INIT_RT_MUTEXES(tsk)
 

Functions

void __rt_mutex_init (struct rt_mutex *lock, const char *name)
 
void rt_mutex_destroy (struct rt_mutex *lock)
 
void rt_mutex_lock (struct rt_mutex *lock)
 
int rt_mutex_lock_interruptible (struct rt_mutex *lock, int detect_deadlock)
 
int rt_mutex_timed_lock (struct rt_mutex *lock, struct hrtimer_sleeper *timeout, int detect_deadlock)
 
int rt_mutex_trylock (struct rt_mutex *lock)
 
void rt_mutex_unlock (struct rt_mutex *lock)
 

Variables

int max_lock_depth
 

Macro Definition Documentation

#define __DEBUG_RT_MUTEX_INITIALIZER (   mutexname)

Definition at line 62 of file rtmutex.h.

#define __RT_MUTEX_INITIALIZER (   mutexname)
Value:
{ .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
, .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \
, .owner = NULL \

Definition at line 67 of file rtmutex.h.

#define DEFINE_RT_MUTEX (   mutexname)    struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)

Definition at line 73 of file rtmutex.h.

#define INIT_RT_MUTEXES (   tsk)

Definition at line 106 of file rtmutex.h.

#define rt_mutex_debug_check_no_locks_held (   task)    do { } while (0)

Definition at line 53 of file rtmutex.h.

#define rt_mutex_debug_task_free (   t)    do { } while (0)

Definition at line 64 of file rtmutex.h.

#define rt_mutex_init (   mutex)    __rt_mutex_init(mutex, NULL)

Definition at line 63 of file rtmutex.h.

Function Documentation

void __rt_mutex_init ( struct rt_mutex lock,
const char name 
)

__rt_mutex_init - initialize the rt lock

: the rt lock to be initialized

Initialize the rt lock to unlocked state.

Initializing of a locked rt lock is not allowed

Definition at line 889 of file rtmutex.c.

void rt_mutex_destroy ( struct rt_mutex lock)

rt_mutex_destroy - mark a mutex unusable : the mutex to be destroyed

This function marks the mutex uninitialized, and any subsequent use of the mutex is forbidden. The mutex must not be locked when this function is called.

Definition at line 870 of file rtmutex.c.

void rt_mutex_lock ( struct rt_mutex lock)

rt_mutex_lock - lock a rt_mutex

: the rt_mutex to be locked

Definition at line 783 of file rtmutex.c.

int rt_mutex_lock_interruptible ( struct rt_mutex lock,
int  detect_deadlock 
)

rt_mutex_lock_interruptible - lock a rt_mutex interruptible

: the rt_mutex to be locked : deadlock detection on/off

Returns: 0 on success -EINTR when interrupted by a signal -EDEADLK when the lock would deadlock (when deadlock detection is on)

Definition at line 802 of file rtmutex.c.

int rt_mutex_timed_lock ( struct rt_mutex lock,
struct hrtimer_sleeper timeout,
int  detect_deadlock 
)

rt_mutex_timed_lock - lock a rt_mutex interruptible the timeout structure is provided by the caller

: the rt_mutex to be locked : timeout structure or NULL (no timeout) : deadlock detection on/off

Returns: 0 on success -EINTR when interrupted by a signal -ETIMEDOUT when the timeout expired -EDEADLK when the lock would deadlock (when deadlock detection is on)

Definition at line 828 of file rtmutex.c.

int rt_mutex_trylock ( struct rt_mutex lock)

rt_mutex_trylock - try to lock a rt_mutex

: the rt_mutex to be locked

Returns 1 on success and 0 on contention

Definition at line 845 of file rtmutex.c.

void rt_mutex_unlock ( struct rt_mutex lock)

rt_mutex_unlock - unlock a rt_mutex

: the rt_mutex to be unlocked

Definition at line 856 of file rtmutex.c.

Variable Documentation

int max_lock_depth

Definition at line 142 of file rtmutex.c.