|
AM243x MCU+ SDK
09.00.00
|
|
Go to the documentation of this file.
57 #ifndef CB_LLD_THREAD_H
58 #define CB_LLD_THREAD_H
72 #define CB_THREAD_T cb_lld_task_t*
73 #define CB_THREAD_CREATE cb_lld_task_create
74 #define CB_THREAD_JOIN cb_lld_task_join
75 #define CB_THREAD_EXIT cb_lld_task_exit
77 #define CB_THREAD_MUTEX_T cb_lld_mutex_t*
78 #define CB_THREAD_MUTEX_LOCK cb_lld_mutex_lock
79 #define CB_THREAD_MUTEX_TRYLOCK cb_lld_mutex_trylock
80 #define CB_THREAD_MUTEX_TIMEDLOCK cb_lld_mutex_timedlock
81 #define CB_THREAD_MUTEX_UNLOCK cb_lld_mutex_unlock
82 #define CB_THREAD_MUTEX_INIT cb_lld_mutex_init
83 #define CB_THREAD_MUTEX_DESTROY cb_lld_mutex_destroy
84 #define CB_STATIC_MUTEX_INITIALIZER(x) x=NULL
85 #define CB_STATIC_MUTEX_CONSTRUCTOR(x) ub_protected_func(cb_lld_global_mutex_init,&(x))
88 #define CB_THREAD_MUTEXATTR_T void*
89 #define CB_THREAD_MUTEXATTR_INIT(a)
90 #define CB_THREAD_MUTEXATTR_SETPSHARED(a,b)
91 #define CB_THREAD_PROCESS_SHARED 0 //PTHREAD_PROCESS_SHARED
93 #define CB_SEM_T cb_lld_sem_t*
94 #define CB_SEM_INIT cb_lld_sem_init
95 #define CB_SEM_WAIT cb_lld_sem_wait
96 #define CB_SEM_TRYWAIT cb_lld_sem_trywait
97 #define CB_SEM_TIMEDWAIT cb_lld_sem_timedwait
98 #define CB_SEM_POST cb_lld_sem_post
99 #define CB_SEM_DESTROY cb_lld_sem_destroy
102 #define CB_THREAD_COND_T void*
103 #define CB_THREAD_COND_INIT(a, b)
104 #define CB_THREAD_COND_DESTROY(a)
105 #define CB_THREAD_COND_WAIT(a, b)
106 #define CB_THREAD_COND_SIGNAL(a)
107 #define CB_THREAD_COND_BROADCAST(a)
265 #endif //CB_LLD_THREAD_H
struct cb_lld_mutex cb_lld_mutex_t
Definition: cb_lld_thread.h:69
int cb_lld_sem_init(CB_SEM_T *sem, int pshared, unsigned int value)
Initializes a semaphore.
int cb_lld_mutex_trylock(CB_THREAD_MUTEX_T *mutex)
Attempts to lock a mutex without blocking.
int cb_lld_sem_post(CB_SEM_T *sem)
Posts (signals) a semaphore, releasing a waiting thread.
#define CB_THREAD_T
Definition: cb_lld_thread.h:72
int cb_lld_mutex_destroy(CB_THREAD_MUTEX_T *mutex)
Destroys a mutex.
struct cb_lld_sem cb_lld_sem_t
Definition: cb_lld_thread.h:68
#define CB_THREAD_MUTEXATTR_T
Definition: cb_lld_thread.h:88
void cb_lld_task_exit(void *retval)
Terminates the calling thread.
#define CB_SEM_T
Definition: cb_lld_thread.h:93
int cb_lld_mutex_unlock(CB_THREAD_MUTEX_T *mutex)
Unlocks a mutex.
int cb_lld_mutex_timedlock(CB_THREAD_MUTEX_T *mutex, struct timespec *abstime)
Locks a mutex and waits until a timeout occurs.
uint32_t value
Definition: tisci_otp_revision.h:2
int cb_lld_sem_wait_status(CB_SEM_T *sem)
Get the semaphore wait status. The return value of this function determines the wait status of cb_lld...
int cb_lld_global_mutex_init(void *mutex)
Initializes a global mutex, similar to the ref cb_lld_mutex_init() except there is no log when error ...
int cb_lld_task_create(CB_THREAD_T *th, void *attr, void *(*func)(void *), void *arg)
Creates a new thread. This function creates a new thread with the specified attributes and starts exe...
int cb_lld_task_join(CB_THREAD_T th, void **retval)
Waits for a thread to terminate. This function waits for the specified thread to terminate.
int cb_lld_sem_trywait(CB_SEM_T *sem)
Attempts to wait on a semaphore without blocking. To know if the semaphore was acquired,...
#define CB_THREAD_MUTEX_T
Definition: cb_lld_thread.h:77
int cb_lld_sem_timedwait(CB_SEM_T *sem, struct timespec *abstime)
Waits on a semaphore until it becomes available or until a timeout occurs. To know if the semaphore w...
int cb_lld_mutex_lock(CB_THREAD_MUTEX_T *mutex)
Locks a mutex.
int cb_lld_mutex_init(CB_THREAD_MUTEX_T *mutex, CB_THREAD_MUTEXATTR_T attr)
Initializes a mutex.
int cb_lld_sem_destroy(CB_SEM_T *sem)
Destroys a semaphore.
struct cb_lld_task cb_lld_task_t
Definition: cb_lld_thread.h:70
int cb_lld_sem_wait(CB_SEM_T *sem)
Waits on a semaphore until it becomes available.