Created
February 19, 2020 16:33
-
-
Save StanisLove/0d31639f5e67990e2cd826ce9e890a9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
threads = Array.new(8) do | |
Thread.new do | |
while arr.any? | |
mutex.synchronize do | |
end | |
elem = arr.pop | |
next if elem.nil? | |
end | |
end | |
end | |
threads.each(&:join) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment