aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-19 17:51:19 +0100
committergingerBill <bill@gingerbill.org>2021-08-19 17:51:19 +0100
commitfa4f3aa7ad3f9530f78f22bd8d0e00d168ab2509 (patch)
treea5970ee21bd91b5a8a409e0e62f92ca94ec57a9c /src/checker.cpp
parenta90fe7211c226ab6dd7580ec2323758a98214bf7 (diff)
Correct atomic usage
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index cd023998c..939872c0c 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -4177,6 +4177,10 @@ void check_with_workers(Checker *c, ThreadProc *proc, isize total_count) {
semaphore_wait(&c->info.collect_semaphore);
for (isize i = 0; i < worker_count; i++) {
+ thread_join(threads+i);
+ }
+
+ for (isize i = 0; i < worker_count; i++) {
thread_destroy(threads+i);
}
}
@@ -4812,6 +4816,10 @@ void check_procedure_bodies(Checker *c) {
semaphore_wait(&c->procs_to_check_semaphore);
for (isize i = 0; i < worker_count; i++) {
+ thread_join(threads+i);
+ }
+
+ for (isize i = 0; i < worker_count; i++) {
thread_destroy(threads+i);
}