From 47513bd32c256c4f35e3a8ced7d9fd7e15903530 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 16 Feb 2021 20:38:53 -0500 Subject: terminal application with ipc, shift+pause state dumper, hello world for terminal, meminfo popup program --- src/user/knob/task.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/user/knob/task.c') diff --git a/src/user/knob/task.c b/src/user/knob/task.c index 3bf3e85..9a49386 100644 --- a/src/user/knob/task.c +++ b/src/user/knob/task.c @@ -1,9 +1,12 @@ -#include #include #include #include #include +#include + +#include + _task_handle_t run_command(const char *path, _task_handle_t stdio_task) { uint8_t dn; path = remove_prefix(path, &dn); @@ -14,9 +17,9 @@ _task_handle_t run_command(const char *path, _task_handle_t stdio_task) { blockcpy(new_path, path, ptr - path); new_path[ptr - path] = '\0'; - bool succeded = _start_task(dn, new_path, ptr + 1, stdio_task); + _task_handle_t handle = _start_task(dn, new_path, ptr + 1, stdio_task); free_block(new_path); - return succeded; + return handle; } return _start_task(dn, path, "", stdio_task); @@ -24,11 +27,12 @@ _task_handle_t run_command(const char *path, _task_handle_t stdio_task) { bool try_run_command_blocking(const char *path, _task_handle_t stdio_task) { _task_handle_t handle = run_command(path, stdio_task); - if (!handle) + if (!handle) { return false; - while (_is_task_running(handle)) { + } + do { _wait_for_task(handle); _yield_task(); - } + } while (_is_task_running(handle)); return true; } \ No newline at end of file -- cgit v1.2.3