#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/cdefs.h>
#include <sys/kassert.h>
#include <sys/kconfig.h>
#include <sys/kdebug.h>
#include <sys/kmem.h>
#include <sys/mp.h>
#include <sys/queue.h>
#include <sys/thread.h>
#include <sys/spinlock.h>
#include <sys/waitchannel.h>
#include <sys/mutex.h>
#include <errno.h>
Go to the source code of this file.
◆ Mutex_Destroy()
void Mutex_Destroy |
( |
Mutex * |
mtx | ) |
|
Definition at line 39 of file mutex.c.
40{
43 return;
44}
void Spinlock_Destroy(Spinlock *lock)
void WaitChannel_Destroy(WaitChannel *wc)
◆ Mutex_Init()
void Mutex_Init |
( |
Mutex * |
mtx, |
|
|
const char * |
name |
|
) |
| |
Definition at line 30 of file mutex.c.
31{
34
35 return;
36}
#define SPINLOCK_TYPE_NORMAL
void Spinlock_Init(Spinlock *lock, const char *name, uint64_t type)
void WaitChannel_Init(WaitChannel *wc, const char *name)
◆ Mutex_Lock()
void Mutex_Lock |
( |
Mutex * |
mtx | ) |
|
Mutex_Lock –
Acquires the mutex.
Definition at line 52 of file mutex.c.
53{
54
55
56
57
59
60
61}
uint32_t Critical_Level()
◆ Mutex_TryLock()
int Mutex_TryLock |
( |
Mutex * |
mtx | ) |
|
Mutex_TryLock –
Attempts to acquire the user mutex. Returns EBUSY if the lock is already taken, otherwise 0 on success.
Definition at line 70 of file mutex.c.
71{
72
73
74 return 0;
75}
◆ Mutex_Unlock()
void Mutex_Unlock |
( |
Mutex * |
mtx | ) |
|
Mutex_Unlock –
Releases the user mutex.
Definition at line 83 of file mutex.c.
◆ curProc
Current thread executing on a given CPU.
Definition at line 41 of file sched.c.