aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-15 17:26:01 +0000
committergingerBill <bill@gingerbill.org>2021-11-15 17:26:01 +0000
commite814a3693f9efbdd00113de4dd5937acd97bc486 (patch)
treeff0534f9609fb8b5726c0933027db9963bb469e4 /src/tokenizer.cpp
parentf55fc4cd08dba25730fa1c74d31611cf27ef2155 (diff)
Improve usage of `file_id`
Diffstat (limited to 'src/tokenizer.cpp')
-rw-r--r--src/tokenizer.cpp6
1 files changed, 3 insertions, 3 deletions
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<String> global_file_path_strings; // index is file id
gb_global Array<struct AstFile *> 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);