mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 01:44:36 +00:00
Lock on possible race condition in parser
This commit is contained in:
@@ -4567,7 +4567,10 @@ GB_THREAD_PROC(parse_worker_file_proc) {
|
||||
if (thread == nullptr) return 0;
|
||||
auto *p = cast(Parser *)thread->user_data;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user