mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Lock on possible race condition in parser
This commit is contained in:
+4
-1
@@ -4567,7 +4567,10 @@ GB_THREAD_PROC(parse_worker_file_proc) {
|
|||||||
if (thread == nullptr) return 0;
|
if (thread == nullptr) return 0;
|
||||||
auto *p = cast(Parser *)thread->user_data;
|
auto *p = cast(Parser *)thread->user_data;
|
||||||
isize index = thread->user_index;
|
isize index = thread->user_index;
|
||||||
ParseFileError err = process_imported_file(p, p->files_to_process[index]);
|
gb_mutex_lock(&p->file_add_mutex);
|
||||||
|
auto file_to_process = p->files_to_process[index];
|
||||||
|
gb_mutex_unlock(&p->file_add_mutex);
|
||||||
|
ParseFileError err = process_imported_file(p, file_to_process);
|
||||||
return cast(isize)err;
|
return cast(isize)err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user