mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-17 05:48:33 +00:00
Revert "Furi Thread: don't use thread pointer after FuriThreadStateStopped callback (#1799)"
This reverts commit 5883e134d4
.
This commit is contained in:
parent
9176387b9f
commit
7df70d7c62
1 changed files with 3 additions and 7 deletions
|
@ -85,6 +85,7 @@ static void furi_thread_body(void* context) {
|
|||
}
|
||||
|
||||
furi_assert(thread->state == FuriThreadStateRunning);
|
||||
furi_thread_set_state(thread, FuriThreadStateStopped);
|
||||
|
||||
if(thread->is_service) {
|
||||
FURI_LOG_E(
|
||||
|
@ -98,10 +99,7 @@ static void furi_thread_body(void* context) {
|
|||
furi_assert(pvTaskGetThreadLocalStoragePointer(NULL, 0) != NULL);
|
||||
vTaskSetThreadLocalStoragePointer(NULL, 0, NULL);
|
||||
|
||||
// from here we can't use thread pointer
|
||||
furi_thread_set_state(thread, FuriThreadStateStopped);
|
||||
|
||||
vTaskDelete(NULL);
|
||||
vTaskDelete(thread->task_handle);
|
||||
furi_thread_catch();
|
||||
}
|
||||
|
||||
|
@ -207,9 +205,7 @@ void furi_thread_start(FuriThread* thread) {
|
|||
bool furi_thread_join(FuriThread* thread) {
|
||||
furi_assert(thread);
|
||||
|
||||
furi_check(furi_thread_get_current() != thread);
|
||||
|
||||
while(eTaskGetState(thread->task_handle) != eDeleted) {
|
||||
while(thread->state != FuriThreadStateStopped) {
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue