shell: add missing mutex protection
Commit: e2e74c0f53
removed mutex
protection from shell_internal_fprintf function. Added missing mutex.
Added missing mutex protection in shell_start function.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
This commit is contained in:
parent
dac8728856
commit
dd9dac8694
1 changed files with 6 additions and 1 deletions
|
@ -1215,8 +1215,10 @@ void shell_thread(void *shell_handle, void *arg_log_backend,
|
||||||
K_FOREVER);
|
K_FOREVER);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
|
k_mutex_lock(&shell->ctx->wr_mtx, K_FOREVER);
|
||||||
shell_internal_fprintf(shell, SHELL_ERROR,
|
shell_internal_fprintf(shell, SHELL_ERROR,
|
||||||
"Shell thread error: %d", err);
|
"Shell thread error: %d", err);
|
||||||
|
k_mutex_unlock(&shell->ctx->wr_mtx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1287,14 +1289,17 @@ int shell_start(const struct shell *shell)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
k_mutex_lock(&shell->ctx->wr_mtx, K_FOREVER);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_SHELL_VT100_COLORS)) {
|
if (IS_ENABLED(CONFIG_SHELL_VT100_COLORS)) {
|
||||||
shell_vt100_color_set(shell, SHELL_NORMAL);
|
shell_vt100_color_set(shell, SHELL_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_raw_fprintf(shell->fprintf_ctx, "\n\n");
|
shell_raw_fprintf(shell->fprintf_ctx, "\n\n");
|
||||||
|
|
||||||
state_set(shell, SHELL_STATE_ACTIVE);
|
state_set(shell, SHELL_STATE_ACTIVE);
|
||||||
|
|
||||||
|
k_mutex_unlock(&shell->ctx->wr_mtx);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue