Browse Source

Remove `global_` prefix from `global_thread_pool_*` procedures

gingerBill 2 years ago
parent
commit
bfdcf900ef
4 changed files with 12 additions and 12 deletions
  1. 6 6
      src/checker.cpp
  2. 1 1
      src/llvm_backend.cpp
  3. 2 2
      src/main.cpp
  4. 3 3
      src/parser.cpp

+ 6 - 6
src/checker.cpp

@@ -4654,9 +4654,9 @@ gb_internal void check_with_workers(Checker *c, WorkerTaskProc *proc, isize tota
 
 
 
 
 	for (isize i = 0; i < thread_count; i++) {
 	for (isize i = 0; i < thread_count; i++) {
-		global_thread_pool_add_task(proc, thread_data+i);
+		thread_pool_add_task(proc, thread_data+i);
 	}
 	}
-	global_thread_pool_wait();
+	thread_pool_wait();
 	semaphore_wait(&c->info.collect_semaphore);
 	semaphore_wait(&c->info.collect_semaphore);
 }
 }
 
 
@@ -4704,9 +4704,9 @@ gb_internal void check_collect_entities_all(Checker *c) {
 	if (build_context.threaded_checker) {
 	if (build_context.threaded_checker) {
 		for (auto const &entry : c->info.files.entries) {
 		for (auto const &entry : c->info.files.entries) {
 			AstFile *f = entry.value;
 			AstFile *f = entry.value;
-			global_thread_pool_add_task(check_collect_entities_all_worker_proc, f);
+			thread_pool_add_task(check_collect_entities_all_worker_proc, f);
 		}
 		}
-		global_thread_pool_wait();
+		thread_pool_wait();
 	} else {
 	} else {
 		for (auto const &entry : c->info.files.entries) {
 		for (auto const &entry : c->info.files.entries) {
 			AstFile *f = entry.value;
 			AstFile *f = entry.value;
@@ -5350,9 +5350,9 @@ gb_internal void check_procedure_bodies(Checker *c) {
 	semaphore_post(&c->procs_to_check_semaphore, cast(i32)thread_count);
 	semaphore_post(&c->procs_to_check_semaphore, cast(i32)thread_count);
 
 
 	for (isize i = 0; i < thread_count; i++) {
 	for (isize i = 0; i < thread_count; i++) {
-		global_thread_pool_add_task(thread_proc_body, thread_data+i);
+		thread_pool_add_task(thread_proc_body, thread_data+i);
 	}
 	}
-	global_thread_pool_wait();
+	thread_pool_wait();
 	semaphore_wait(&c->procs_to_check_semaphore);
 	semaphore_wait(&c->procs_to_check_semaphore);
 
 
 	isize global_remaining = c->procs_to_check_queue.count.load(std::memory_order_relaxed);
 	isize global_remaining = c->procs_to_check_queue.count.load(std::memory_order_relaxed);

+ 1 - 1
src/llvm_backend.cpp

@@ -2272,7 +2272,7 @@ gb_internal void lb_generate_code(lbGenerator *gen) {
 			wd->code_gen_file_type = code_gen_file_type;
 			wd->code_gen_file_type = code_gen_file_type;
 			wd->filepath_obj = filepath_obj;
 			wd->filepath_obj = filepath_obj;
 			wd->m = m;
 			wd->m = m;
-			global_thread_pool_add_task(lb_llvm_emit_worker_proc, wd);
+			thread_pool_add_task(lb_llvm_emit_worker_proc, wd);
 		}
 		}
 
 
 		thread_pool_wait(&global_thread_pool);
 		thread_pool_wait(&global_thread_pool);

+ 2 - 2
src/main.cpp

@@ -20,10 +20,10 @@ gb_internal void init_global_thread_pool(void) {
 	isize worker_count = thread_count-1; // NOTE(bill): The main thread will also be used for work
 	isize worker_count = thread_count-1; // NOTE(bill): The main thread will also be used for work
 	thread_pool_init(&global_thread_pool, permanent_allocator(), worker_count, "ThreadPoolWorker");
 	thread_pool_init(&global_thread_pool, permanent_allocator(), worker_count, "ThreadPoolWorker");
 }
 }
-gb_internal bool global_thread_pool_add_task(WorkerTaskProc *proc, void *data) {
+gb_internal bool thread_pool_add_task(WorkerTaskProc *proc, void *data) {
 	return thread_pool_add_task(&global_thread_pool, proc, data);
 	return thread_pool_add_task(&global_thread_pool, proc, data);
 }
 }
-gb_internal void global_thread_pool_wait(void) {
+gb_internal void thread_pool_wait(void) {
 	thread_pool_wait(&global_thread_pool);
 	thread_pool_wait(&global_thread_pool);
 }
 }
 
 

+ 3 - 3
src/parser.cpp

@@ -4910,7 +4910,7 @@ gb_internal void parser_add_file_to_process(Parser *p, AstPackage *pkg, FileInfo
 	auto wd = gb_alloc_item(permanent_allocator(), ParserWorkerData);
 	auto wd = gb_alloc_item(permanent_allocator(), ParserWorkerData);
 	wd->parser = p;
 	wd->parser = p;
 	wd->imported_file = f;
 	wd->imported_file = f;
-	global_thread_pool_add_task(parser_worker_proc, wd);
+	thread_pool_add_task(parser_worker_proc, wd);
 }
 }
 
 
 gb_internal WORKER_TASK_PROC(foreign_file_worker_proc) {
 gb_internal WORKER_TASK_PROC(foreign_file_worker_proc) {
@@ -4948,7 +4948,7 @@ gb_internal void parser_add_foreign_file_to_process(Parser *p, AstPackage *pkg,
 	wd->parser = p;
 	wd->parser = p;
 	wd->imported_file = f;
 	wd->imported_file = f;
 	wd->foreign_kind = kind;
 	wd->foreign_kind = kind;
-	global_thread_pool_add_task(foreign_file_worker_proc, wd);
+	thread_pool_add_task(foreign_file_worker_proc, wd);
 }
 }
 
 
 
 
@@ -5798,7 +5798,7 @@ gb_internal ParseFileError parse_packages(Parser *p, String init_filename) {
 		}
 		}
 	}
 	}
 	
 	
-	global_thread_pool_wait();
+	thread_pool_wait();
 
 
 	for (ParseFileErrorNode *node = p->file_error_head; node != nullptr; node = node->next) {
 	for (ParseFileErrorNode *node = p->file_error_head; node != nullptr; node = node->next) {
 		if (node->err != ParseFile_None) {
 		if (node->err != ParseFile_None) {