1
0
mirror of https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git synced 2026-07-11 08:04:25 +00:00

Prevent concurrency issues by blocking until background threads are killed

This commit is contained in:
Alessandro Ranellucci
2014-07-04 12:12:15 +02:00
parent b926079fd5
commit 07f8fb1264
+3 -1
View File
@@ -190,10 +190,12 @@ sub thread_cleanup {
sub kill_all_threads {
# detach any running thread created in the current one
my @killed = ();
foreach my $thread (grep defined($_), map threads->object($_), @threads) {
$thread->kill('KILL');
$thread->detach;
push @killed, $thread;
}
$_->join for @killed; # block until threads are killed
@threads = ();
}