More correct elf loader (#1839)

* ELF File: more robust section loader
* ELF File: faster and smaller preinit, init and fini arrays handling
* ELF File: load sections on preload stage
* ELF File: naming
* Furi: fix use after free in thread join

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-10-08 03:06:29 +10:00
committed by GitHub
parent 1a1f711897
commit 37b5e58a60
4 changed files with 100 additions and 130 deletions

View File

@@ -103,6 +103,7 @@ static void furi_thread_body(void* context) {
furi_assert(pvTaskGetThreadLocalStoragePointer(NULL, 0) != NULL);
vTaskSetThreadLocalStoragePointer(NULL, 0, NULL);
thread->task_handle = NULL;
vTaskDelete(NULL);
furi_thread_catch();
}
@@ -211,13 +212,8 @@ bool furi_thread_join(FuriThread* thread) {
furi_check(furi_thread_get_current() != thread);
// Check if thread was started
if(thread->task_handle == NULL) {
return false;
}
// Wait for thread to stop
while(eTaskGetState(thread->task_handle) != eDeleted) {
while(thread->task_handle) {
furi_delay_ms(10);
}