diff options
| author | gingerBill <bill@gingerbill.org> | 2018-11-29 20:27:48 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-11-29 20:27:48 +0000 |
| commit | 3aec78b1d459a68518d775c3bb75c13f43acbb37 (patch) | |
| tree | 95574f5ba43ab43e2a2a540a04c2b02bcdd921c1 /src/parser.cpp | |
| parent | a3e6e8d304b56208f4faf3decc7e4b658e2f8679 (diff) | |
Lock on possible race condition in parser
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index e7181bfbb..e64c42ed5 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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; } |