ubthread.c File Reference

#include <ubixos/ubthread.h>
#include <ubixos/vitals.h>
#include <ubixos/exec.h>
#include <ubixos/sched.h>
#include <ubixos/time.h>
#include <ubixos/spinlock.h>
#include <lib/kmalloc.h>
#include <lib/kprintf.h>

Go to the source code of this file.

Functions

int ubthread_cond_destroy (ubthread_cond_t *cond)
int ubthread_cond_init (ubthread_cond_t *cond, const uInt32 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 attr)
int ubthread_mutex_lock (ubthread_mutex_t *mutex)
int ubthread_mutex_unlock (ubthread_mutex_t *mutex)
kTask_tubthread_self ()

Variables

ubthread_cond_listconds = 0x0
ubthread_mutex_listmutex = 0x0


Function Documentation

int ubthread_cond_destroy ( ubthread_cond_t cond  ) 

Definition at line 65 of file ubthread.c.

References kfree().

Referenced by sys_sem_free_().

int ubthread_cond_init ( ubthread_cond_t cond,
const uInt32  attr 
)

Definition at line 49 of file ubthread.c.

References ubthread_cond::id, kmalloc(), ubthread_cond::locked, and UNLOCKED.

Referenced by sys_sem_new_().

int ubthread_cond_signal ( ubthread_cond_t cond  ) 

Definition at line 126 of file ubthread.c.

References ubthread_cond::locked, and UNLOCKED.

Referenced by sys_sem_signal().

int ubthread_cond_timedwait ( ubthread_cond_t cond,
ubthread_mutex_t mutex,
const struct timespec abstime 
)

Definition at line 106 of file ubthread.c.

References ubthread_mutex::locked, ubthread_cond::locked, mutex, sched_yield(), systemVitals, and UNLOCKED.

Referenced by cond_wait().

int ubthread_cond_wait ( ubthread_cond_t cond,
ubthread_mutex_t mutex 
)

Definition at line 118 of file ubthread.c.

References ubthread_mutex::locked, LOCKED, ubthread_cond::locked, mutex, sched_yield(), and UNLOCKED.

Referenced by cond_wait().

int ubthread_create ( kTask_t **  thread,
const uInt32 attr,
void(*)(void)  tproc,
void *  arg 
)

Definition at line 77 of file ubthread.c.

References execThread(), kmalloc(), and x2000.

Referenced by sys_thread_new().

int ubthread_mutex_destroy ( ubthread_mutex_t mutex  ) 

Definition at line 71 of file ubthread.c.

References kfree(), and mutex.

Referenced by sys_sem_free_().

int ubthread_mutex_init ( ubthread_mutex_t mutex,
const uInt32  attr 
)

Definition at line 57 of file ubthread.c.

References ubthread_mutex::id, kmalloc(), ubthread_mutex::locked, mutex, and UNLOCKED.

Referenced by sys_sem_new_().

int ubthread_mutex_lock ( ubthread_mutex_t mutex  ) 

Definition at line 82 of file ubthread.c.

References _current, taskStruct::id, kprintf(), LOCKED, ubthread_mutex::locked, mutex, and ubthread_mutex::pid.

Referenced by sys_arch_sem_wait(), and sys_sem_signal().

int ubthread_mutex_unlock ( ubthread_mutex_t mutex  ) 

Definition at line 93 of file ubthread.c.

References _current, taskStruct::id, ubthread_mutex::locked, mutex, ubthread_mutex::pid, and UNLOCKED.

Referenced by sys_arch_sem_wait(), and sys_sem_signal().

kTask_t* ubthread_self (  ) 

Definition at line 45 of file ubthread.c.

References _current.

Referenced by current_thread().


Variable Documentation

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 cond_wait(), ubthread_cond_timedwait(), ubthread_cond_wait(), ubthread_mutex_destroy(), ubthread_mutex_init(), ubthread_mutex_lock(), and ubthread_mutex_unlock().


Generated on Sun Dec 3 02:38:09 2006 for UbixOS V2 by  doxygen 1.4.7