|
@@ -103,14 +103,18 @@ pool_join :: proc(pool: ^Pool) {
|
|
|
|
|
|
yield()
|
|
yield()
|
|
|
|
|
|
|
|
+ // Because we already stopped the pool, there's no need to take a lock here.
|
|
|
|
+
|
|
started_count: int
|
|
started_count: int
|
|
for started_count < len(pool.threads) {
|
|
for started_count < len(pool.threads) {
|
|
started_count = 0
|
|
started_count = 0
|
|
for t in pool.threads {
|
|
for t in pool.threads {
|
|
if .Started in t.flags {
|
|
if .Started in t.flags {
|
|
- join(t)
|
|
|
|
started_count += 1
|
|
started_count += 1
|
|
}
|
|
}
|
|
|
|
+ if .Joined not_in t.flags {
|
|
|
|
+ join(t)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|