summaryrefslogtreecommitdiffhomepage
path: root/test/ruby/hooks/on_thread_shutdown.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/hooks/on_thread_shutdown.rb')
-rw-r--r--test/ruby/hooks/on_thread_shutdown.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/hooks/on_thread_shutdown.rb b/test/ruby/hooks/on_thread_shutdown.rb
index e65c1b42..d953b8b7 100644
--- a/test/ruby/hooks/on_thread_shutdown.rb
+++ b/test/ruby/hooks/on_thread_shutdown.rb
@@ -1,5 +1,9 @@
require 'securerandom'
+@mutex = Mutex.new
+
on_thread_shutdown do
- File.write("./cookie_thread_shutdown.#{SecureRandom.hex}", "shutdown")
+ @mutex.synchronize do
+ File.write("./cookie_thread_shutdown.#{SecureRandom.hex}", "shutdown")
+ end
end