UbixOS
2.0
|
#include <ubixos/ubthread.h>
#include <ubixos/exec.h>
#include <ubixos/sched.h>
#include <ubixos/time.h>
#include <ubixos/spinlock.h>
#include <ubixos/vitals.h>
#include <lib/kmalloc.h>
#include <lib/kprintf.h>
#include <ubixos/kpanic.h>
#include <sys/stdatomic.h>
Go to the source code of this file.
Functions | |
int | ubthread_cond_broadcast (ubthread_cond_t *cond) |
int | ubthread_cond_destroy (ubthread_cond_t *cond) |
int | ubthread_cond_init (ubthread_cond_t *cond, const uint32_t attr) |
int | ubthread_cond_signal (ubthread_cond_t *cond) |
int | ubthread_cond_timedwait (ubthread_cond_t *cond, ubthread_mutex_t *mutex, const struct timespec *abstime) |
int | ubthread_cond_wait (ubthread_cond_t *cond, ubthread_mutex_t *mutex) |
int | ubthread_create (kTask_t **thread, const uInt32 *attr, void(*tproc)(void), void *arg) |
int | ubthread_mutex_destroy (ubthread_mutex_t *mutex) |
int | ubthread_mutex_init (ubthread_mutex_t *mutex, const uint32_t attr) |
int | ubthread_mutex_lock (ubthread_mutex_t *mutex) |
int | ubthread_mutex_unlock (ubthread_mutex_t *mutex) |
kTask_t * | ubthread_self () |
Variables | |
struct ubthread_cond_list * | conds = 0x0 |
struct ubthread_mutex_list * | mutex = 0x0 |
int ubthread_cond_broadcast | ( | ubthread_cond_t * | cond | ) |
Definition at line 164 of file ubthread.c.
Referenced by sys_sem_signal().
int ubthread_cond_destroy | ( | ubthread_cond_t * | cond | ) |
Definition at line 71 of file ubthread.c.
References kfree().
Referenced by sem_destroy().
int ubthread_cond_init | ( | ubthread_cond_t * | cond, |
const uint32_t | attr | ||
) |
Definition at line 49 of file ubthread.c.
References ATOMIC_VAR_INIT, ubthread_cond::id, kmalloc(), ubthread_cond::lock, and memset().
int ubthread_cond_signal | ( | ubthread_cond_t * | cond | ) |
Definition at line 157 of file ubthread.c.
int ubthread_cond_timedwait | ( | ubthread_cond_t * | cond, |
ubthread_mutex_t * | mutex, | ||
const struct timespec * | abstime | ||
) |
Definition at line 129 of file ubthread.c.
References FALSE, ubthread_cond::lock, mutex, sched_yield(), systemVitals, vitalsStruct::sysUptime, ubthread_mutex_lock(), and ubthread_mutex_unlock().
int ubthread_cond_wait | ( | ubthread_cond_t * | cond, |
ubthread_mutex_t * | mutex | ||
) |
Definition at line 148 of file ubthread.c.
References ubthread_cond::lock, mutex, sched_yield(), TRUE, ubthread_mutex_lock(), and ubthread_mutex_unlock().
Definition at line 83 of file ubthread.c.
References execThread().
int ubthread_mutex_destroy | ( | ubthread_mutex_t * | mutex | ) |
Definition at line 77 of file ubthread.c.
References kfree(), and mutex.
Referenced by sem_destroy(), and sys_mutex_free().
int ubthread_mutex_init | ( | ubthread_mutex_t * | mutex, |
const uint32_t | attr | ||
) |
Definition at line 60 of file ubthread.c.
References ATOMIC_VAR_INIT, ubthread_mutex::id, kmalloc(), ubthread_mutex::lock, memset(), and mutex.
int ubthread_mutex_lock | ( | ubthread_mutex_t * | mutex | ) |
Definition at line 88 of file ubthread.c.
References _current, taskStruct::id, kpanic(), kprintf(), ubthread_mutex::lock, mutex, ubthread_mutex::pid, and TRUE.
Referenced by sys_arch_sem_wait(), sys_mutex_lock(), sys_sem_signal(), ubthread_cond_timedwait(), and ubthread_cond_wait().
int ubthread_mutex_unlock | ( | ubthread_mutex_t * | mutex | ) |
Definition at line 109 of file ubthread.c.
References _current, taskStruct::id, kpanic(), kprintf(), ubthread_mutex::lock, mutex, ubthread_mutex::pid, and TRUE.
Referenced by sys_mutex_unlock(), sys_sem_signal(), ubthread_cond_timedwait(), and ubthread_cond_wait().
kTask_t* ubthread_self | ( | ) |
Definition at line 45 of file ubthread.c.
References _current.
struct ubthread_cond_list* conds = 0x0 |
Definition at line 42 of file ubthread.c.
struct ubthread_mutex_list* mutex = 0x0 |
Definition at line 43 of file ubthread.c.
Referenced by sys_mutex_free(), sys_mutex_lock(), sys_mutex_new(), sys_mutex_unlock(), ubthread_cond_timedwait(), ubthread_cond_wait(), ubthread_mutex_destroy(), ubthread_mutex_init(), ubthread_mutex_lock(), and ubthread_mutex_unlock().