LAR Library: task.h File Reference

LAR Library

task.h File Reference

Multi-threading. More...

#include <larlib/base.h>

Go to the source code of this file.

Macros

#define TASK_INFINITE_TIMEOUT   (0xFFFFFFFFLU)
 Use this constant to wait forever when a timeout is necessary. More...
 

Typedefs

typedef struct taskThread_t taskThread_t
 A handle to a running thread.
 
typedef void(* taskThreadFunction_t) (void *param)
 Type of a function pointer to be used as entry point of a new thread. More...
 
typedef struct taskQueue_t taskQueue_t
 Handle to a multi-threading queue.
 
typedef struct taskSemaphore_t taskSemaphore_t
 Handle to a semaphore.
 
typedef struct taskEvent_t taskEvent_t
 Handle to an event.
 

Functions

taskThread_ttaskThreadCreate (taskThreadFunction_t fn, void *param, uint32_t stackSize)
 Create a new execution thread with entry point fn. More...
 
void taskSleep (uint32_t timeout)
 Sleep the current running thread. More...
 
taskThread_ttaskThreadCurrent (void)
 Return the handle of the current running thread. More...
 
taskQueue_ttaskQueueCreate (int maxItems)
 Create a new queue with up to maxItems allowed. More...
 
void taskQueueDestroy (taskQueue_t *q)
 Destroy a queue and discards all pending elements. More...
 
int taskQueuePost (taskQueue_t *q, void *item)
 Insert an element on the back of the queue q. More...
 
int taskQueuePop (taskQueue_t *q, void **item, uint32_t timeout)
 Extract the element from the front of the queue. More...
 
taskSemaphore_ttaskSemaphoreCreate (int limit)
 Create a semaphore with a maximum entry count of limit. More...
 
void taskSemaphoreDestroy (taskSemaphore_t *s)
 Destroy an existing semaphore. More...
 
int taskSemaphoreAcquire (taskSemaphore_t *s, uint32_t timeout)
 Acquire (also called wait or down) the semaphore. More...
 
int taskSemaphoreRelease (taskSemaphore_t *s)
 Release (also called signal or up) a previously acquired semaphore. More...
 
taskEvent_ttaskEventCreate (void)
 Create a new event handler. More...
 
taskEvent_ttaskEventCreateSystem (uint32_t bitmask)
 Creates an event handler to wait for system peripheral events. More...
 
void taskEventDestroy (taskEvent_t *e)
 Release the resources associated with an event handler. More...
 
int taskEventSignal (taskEvent_t *e)
 Set an event to the signaled state. More...
 
int taskEventCheck (taskEvent_t *e)
 Check if an event if signaled, without waiting or clearing the signal. More...
 
int taskEventWait (taskEvent_t *e, uint32_t timeout)
 Wait for e to change to signaled state. More...
 
int taskEventWaitAny (taskEvent_t *events[], int nevents, uint32_t timeout)
 Wait for at least one among a list of events to be signaled. More...
 
int taskEventClear (taskEvent_t *e)
 Set an event as non-signaled. More...
 

Detailed Description

Multi-threading.

Generated on Mon Mar 27 2017 15:42:52 for LAR Library by   doxygen 1.8.9.1