HALFRED  0.4.0
hali_os_task.h
Go to the documentation of this file.
1 
10 #ifndef HALI_OS_TASK_H
11 #define HALI_OS_TASK_H
12 
14 typedef struct OSTaskDesc {
16  OSTaskNativeHandle handle;
20  void* arg;
22  int result;
24  int features;
26  OSSem joinSem;
28  volatile sig_atomic_t killSignal;
30  OSCntSem wakeupSem;
31 } OSTaskDesc;
32 
33 
34 bool HAL_PORT_OSTASK_Create(OSTask task, OSTaskPriority priority, size_t stackSize);
35 bool HAL_PORT_OSTASK_IsValid(OSTaskNativeHandle handle);
36 void HAL_PORT_OSTASK_Destroy(OSTaskNativeHandle handle);
37 OSTask HAL_PORT_OSTASK_GetCurrentTask();
38 bool HAL_PORT_OSTASK_Suspend(OSTaskNativeHandle handle);
39 bool HAL_PORT_OSTASK_Resume(OSTaskNativeHandle handle);
40 void HAL_PORT_OSTASK_Yield();
41 OSTaskPriority HAL_PORT_OSTASK_GetPriority(OSTaskNativeHandle handle);
42 bool HAL_PORT_OSTASK_SetPriority(OSTaskNativeHandle handle, OSTaskPriority priority);
43 
44 
45 #endif /* HALI_OS_TASK_H */
Definition of an OSTask descriptor.
Definition: hali_os_task.h:14
int(* OSTaskFunction)(void *arg)
Type that defines the task function.
Definition: hal_os_task.h:225
OSTaskNativeHandle handle
native OS thread handle
Definition: hali_os_task.h:16
void * arg
task argument
Definition: hali_os_task.h:20
OSTaskPriority
Possible task priorities.
Definition: hal_os_task.h:228
OSTaskFunction taskFunc
task implementation func
Definition: hali_os_task.h:18
int features
task features
Definition: hali_os_task.h:24
OSCntSem wakeupSem
counting semaphore to realize the sleepy feature of a task
Definition: hali_os_task.h:30
int result
task result
Definition: hali_os_task.h:22
struct OSTaskDesc OSTaskDesc
Definition of an OSTask descriptor.
volatile sig_atomic_t killSignal
signal to realize the mortal feature of a task
Definition: hali_os_task.h:28
OSSem joinSem
semaphore used to realize the joinable feature of a task
Definition: hali_os_task.h:26