diff options
author | Paul Selkirk <paul@psgd.org> | 2017-04-29 23:24:37 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2017-04-29 23:24:37 -0400 |
commit | 73b784eac101085b8734d2188ae59b5295a80839 (patch) | |
tree | be0fc88813aaf5c7c8198e2ab35caa7748897a02 /task.h | |
parent | e0e97a5217bbb2a198d23ac632de97b4ebe0e44a (diff) |
Add minimal mutexes to the minimal tasking system
Diffstat (limited to 'task.h')
-rw-r--r-- | task.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -45,6 +45,8 @@ typedef enum task_state { typedef struct task_cb tcb_t; +typedef struct { unsigned locked; } task_mutex_t; + typedef void (*funcp_t)(void); extern tcb_t *task_add(char *name, funcp_t func, void *cookie, void *stack, size_t stack_len); @@ -67,4 +69,7 @@ extern tcb_t *task_iterate(tcb_t *t); extern void task_delay(uint32_t delay); +extern void task_mutex_lock(task_mutex_t *mutex); +extern void task_mutex_unlock(task_mutex_t *mutex); + #endif /* _TASK_H_ */ |