Defines | |
#define | LOCK_MAX_ACQUIRES 255 |
Maximum number of recursive acquires. | |
Functions | |
void | init_lock (struct lock *k, const char *name) |
void | acquire (struct lock *k) |
int | is_held (struct lock *k) |
void | release (struct lock *k) |
void acquire | ( | struct lock * | k | ) |
Acquire the lock 'k'. If another thread holds the lock yield until it is available, then take it. A thread can recursively acquire the same lock multiple times, but it must release once for every acquire.
k | Lock to acquire. Must be non-null. |
void init_lock | ( | struct lock * | k, | |
const char * | name | |||
) |
Initialize the lock 'k'. This routine must be called before lock 'k' is used.
k | Lock to initialize, must be non-null. | |
name | Debugging name for lock. |
int is_held | ( | struct lock * | k | ) |
Checks to see if lock 'k' is held by the current thread.
k | Lock to check. Must be non-null. |
void release | ( | struct lock * | k | ) |
Release the lock 'k'.
k | Lock to release. Must be non-null. |