aboutsummaryrefslogtreecommitdiff
path: root/challenge-142
diff options
context:
space:
mode:
authorMatthew Neleigh <matthew.neleigh@gmail.com>2021-12-09 15:46:48 -0500
committerMatthew Neleigh <matthew.neleigh@gmail.com>2021-12-09 15:46:48 -0500
commit7d9b0eb49eb55699efe17cd7656187bf927866a5 (patch)
tree6139f16841e0d5326b87e68bf95c78356c7a567b /challenge-142
parentcc43fb0a254f63c30b0c2ad5f80a88b80ec8c8f2 (diff)
downloadperlweeklychallenge-club-7d9b0eb49eb55699efe17cd7656187bf927866a5.tar.gz
perlweeklychallenge-club-7d9b0eb49eb55699efe17cd7656187bf927866a5.tar.bz2
perlweeklychallenge-club-7d9b0eb49eb55699efe17cd7656187bf927866a5.zip
modified: challenge-142/mattneleigh/perl/ch-2.pl
Diffstat (limited to 'challenge-142')
-rwxr-xr-xchallenge-142/mattneleigh/perl/ch-2.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/challenge-142/mattneleigh/perl/ch-2.pl b/challenge-142/mattneleigh/perl/ch-2.pl
index bde49a7012..808385b5e9 100755
--- a/challenge-142/mattneleigh/perl/ch-2.pl
+++ b/challenge-142/mattneleigh/perl/ch-2.pl
@@ -94,7 +94,9 @@ sub _sleep_sort_thread_core{
# that's iffy if the CPU is busy
select(undef, undef, undef, 0.1 * $value);
- # Store the value in the shared list
+ # Lock the shared list, and store the
+ # value therein
+ lock($sorted);
push(@{$sorted}, $value);
return(undef);