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 --- projects/hsm/hsm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'projects/hsm/hsm.c') diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c index a683b7f..60fa2bd 100644 --- a/projects/hsm/hsm.c +++ b/projects/hsm/hsm.c @@ -380,6 +380,12 @@ void hal_task_yield(void) task_yield(); } +/* A mutex to arbitrate concurrent access to the keystore. + */ +task_mutex_t ks_mutex = { 0 }; +void hal_ks_lock(void) { task_mutex_lock(&ks_mutex); } +void hal_ks_unlock(void) { task_mutex_unlock(&ks_mutex); } + /* The main task. This does all the setup, and the worker tasks handle * the rest. */ -- cgit v1.2.3