Use RwMutex for gen_procs

This commit is contained in:
gingerBill
2023-01-03 15:47:25 +00:00
parent 485c606672
commit 774fea1e63
4 changed files with 20 additions and 23 deletions
+3 -8
View File
@@ -317,7 +317,7 @@ struct LoadFileCache {
struct GenProcsData {
Array<Entity *> procs;
BlockingMutex mutex;
RwMutex mutex;
};
// CheckerInfo stores all the symbol information for a type-checked program
@@ -347,14 +347,9 @@ struct CheckerInfo {
// Below are accessed within procedures
// NOTE(bill): If the semantic checker (check_proc_body) is to ever to be multithreaded,
// these variables will be of contention
Semaphore collect_semaphore;
RwMutex global_untyped_mutex;
UntypedExprInfoMap global_untyped; // NOTE(bill): This needs to be a map and not on the Ast
// as it needs to be iterated across afterwards
BlockingMutex global_untyped_mutex;
BlockingMutex builtin_mutex;
BlockingMutex type_and_value_mutex;
@@ -388,7 +383,7 @@ struct CheckerInfo {
BlockingMutex load_file_mutex;
StringMap<LoadFileCache *> load_file_cache;
BlockingMutex all_procedures_mutex;;
BlockingMutex all_procedures_mutex;
Array<ProcInfo *> all_procedures;
};