From e814a3693f9efbdd00113de4dd5937acd97bc486 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 15 Nov 2021 17:26:01 +0000 Subject: Improve usage of `file_id` --- src/tokenizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tokenizer.cpp') diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 10b4494d7..b7ade9d89 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -192,7 +192,7 @@ gb_global Array global_file_path_strings; // index is file id gb_global Array global_files; // index is file id String get_file_path_string(i32 index); -struct AstFile *get_ast_file_from_id(i32 index); +struct AstFile *thread_safe_get_ast_file_from_id(i32 index); struct TokenPos { i32 file_id; @@ -318,7 +318,7 @@ bool set_file_path_string(i32 index, String const &path) { return ok; } -bool set_ast_file_from_id(i32 index, AstFile *file) { +bool thread_safe_set_ast_file_from_id(i32 index, AstFile *file) { bool ok = false; GB_ASSERT(index >= 0); mutex_lock(&global_error_collector.string_mutex); @@ -349,7 +349,7 @@ String get_file_path_string(i32 index) { return path; } -AstFile *get_ast_file_from_id(i32 index) { +AstFile *thread_safe_get_ast_file_from_id(i32 index) { GB_ASSERT(index >= 0); mutex_lock(&global_error_collector.string_mutex); -- cgit v1.2.3