From 73b784eac101085b8734d2188ae59b5295a80839 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Sat, 29 Apr 2017 23:24:37 -0400 Subject: Add minimal mutexes to the minimal tasking system --- task.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'task.h') diff --git a/task.h b/task.h index 9178c2d..f4d4260 100644 --- a/task.h +++ b/task.h @@ -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_ */ -- cgit v1.2.3