LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
mutex.h File Reference

(7c4d7d1 userspace/term: change eyecandy inclusion to use objcopy instead of xxd)

#include <stdint.h>
#include <scheduler.h>
+ Include dependency graph for mutex.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint64_t mutex_t
 

Functions

void init_mutex (void)
 
mutex_t mutex_create (void)
 
void mutex_destroy (mutex_t mutex)
 
bool mutex_lock (mutex_t mutex, pid_t holder)
 
bool mutex_unlock (mutex_t mutex, pid_t holder)
 
void mutex_unlock_holder (pid_t holder)
 

Typedef Documentation

◆ mutex_t

typedef uint64_t mutex_t

Definition at line 6 of file mutex.h.

Function Documentation

◆ init_mutex()

void init_mutex ( void  )

Definition at line 20 of file mutex.c.

References kernel_alloc, mutexes, and tpa_new().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex_create()

mutex_t mutex_create ( void  )

Definition at line 24 of file mutex.c.

References mutexes, next_mutex, panic_message(), mutex_data::state, and tpa_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex_destroy()

void mutex_destroy ( mutex_t  mutex)

Definition at line 38 of file mutex.c.

References logw, mutex, mutexes, panic_message(), mutex_data::state, tpa_get(), and tpa_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex_lock()

bool mutex_lock ( mutex_t  mutex,
pid_t  holder 
)

Definition at line 52 of file mutex.c.

References mutex_data::holder, mutex, mutexes, panic_message(), mutex_data::state, and tpa_get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex_unlock()

bool mutex_unlock ( mutex_t  mutex,
pid_t  holder 
)

Definition at line 68 of file mutex.c.

References mutex_data::holder, logw, mutex, wait_data::mutex, mutexes, panic_message(), scheduler_waitable_done(), mutex_data::state, tpa_get(), and wait_reason_mutex.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex_unlock_holder()

void mutex_unlock_holder ( pid_t  holder)

Definition at line 95 of file mutex.c.

References mutex_data::holder, logd, logw, mutex, mutex_unlock(), mutexes, pid, mutex_data::state, tpa_get(), and tpa_next().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: