From 7d9b0eb49eb55699efe17cd7656187bf927866a5 Mon Sep 17 00:00:00 2001 From: Matthew Neleigh Date: Thu, 9 Dec 2021 15:46:48 -0500 Subject: modified: challenge-142/mattneleigh/perl/ch-2.pl --- challenge-142/mattneleigh/perl/ch-2.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit