Browse Source

Remove some unneeded checks

gingerBill 2 years ago
parent
commit
ad52003077
2 changed files with 5 additions and 3 deletions
  1. 2 2
      src/checker.cpp
  2. 3 1
      src/thread_pool.cpp

+ 2 - 2
src/checker.cpp

@@ -1978,8 +1978,8 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) {
 
 
 
 
 
 
-gb_global std::atomic<bool> global_procedure_body_in_worker_queue = false;
-gb_global std::atomic<bool> global_after_checking_procedure_bodies = false;
+gb_global std::atomic<bool> global_procedure_body_in_worker_queue;
+gb_global std::atomic<bool> global_after_checking_procedure_bodies;
 
 
 gb_internal WORKER_TASK_PROC(check_proc_info_worker_proc);
 gb_internal WORKER_TASK_PROC(check_proc_info_worker_proc);
 
 

+ 3 - 1
src/thread_pool.cpp

@@ -142,6 +142,8 @@ gb_internal THREAD_PROC(thread_pool_thread_proc) {
 	while (pool->running.load()) {
 	while (pool->running.load()) {
 		// If we've got tasks to process, work through them
 		// If we've got tasks to process, work through them
 		usize finished_tasks = 0;
 		usize finished_tasks = 0;
+		i32 state;
+
 		while (thread_pool_queue_pop(current_thread, &task)) {
 		while (thread_pool_queue_pop(current_thread, &task)) {
 			task.do_work(task.data);
 			task.do_work(task.data);
 			pool->tasks_left.fetch_sub(1, std::memory_order_release);
 			pool->tasks_left.fetch_sub(1, std::memory_order_release);
@@ -180,7 +182,7 @@ gb_internal THREAD_PROC(thread_pool_thread_proc) {
 		}
 		}
 
 
 		// if we've done all our work, and there's nothing to steal, go to sleep
 		// if we've done all our work, and there's nothing to steal, go to sleep
-		i32 state = pool->tasks_available.load();
+		state = pool->tasks_available.load();
 		futex_wait(&pool->tasks_available, state);
 		futex_wait(&pool->tasks_available, state);
 
 
 		main_loop_continue:;
 		main_loop_continue:;