summaryrefslogtreecommitdiff
path: root/src/user/knob
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/knob')
-rw-r--r--src/user/knob/task.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/user/knob/task.c b/src/user/knob/task.c
index 598bee2..df5d38f 100644
--- a/src/user/knob/task.c
+++ b/src/user/knob/task.c
@@ -4,7 +4,7 @@
#include <knob/heap.h>
#include <knob/block.h>
-bool try_run_command(const char *path) {
+_task_handle_t run_command(const char *path) {
uint8_t dn;
path = remove_prefix(path, &dn);
@@ -22,6 +22,15 @@ bool try_run_command(const char *path) {
return _start_task(dn, path, "");
}
+bool try_run_command_blocking(const char *path) {
+ _task_handle_t handle = run_command(path);
+ if (!handle)
+ return false;
+ _wait_for_task(handle);
+ _yield_task();
+ return true;
+}
+
void yield_task() {
_yield_task();
} \ No newline at end of file