aboutsummaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-04-29 23:24:37 -0400
committerPaul Selkirk <paul@psgd.org>2017-04-29 23:24:37 -0400
commit73b784eac101085b8734d2188ae59b5295a80839 (patch)
treebe0fc88813aaf5c7c8198e2ab35caa7748897a02 /projects
parente0e97a5217bbb2a198d23ac632de97b4ebe0e44a (diff)
Add minimal mutexes to the minimal tasking system
Diffstat (limited to 'projects')
-rw-r--r--projects/hsm/hsm.c6
1 files changed, 6 insertions, 0 deletions
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.
*/