Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/timeout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def self.create_timeout_thread

def self.ensure_timeout_thread_created
unless @timeout_thread and @timeout_thread.alive?
# If the Mutex is already owned we are in a signal handler.
# In that case, just return and let the main thread create the @timeout_thread.
return if TIMEOUT_THREAD_MUTEX.owned?
TIMEOUT_THREAD_MUTEX.synchronize do
unless @timeout_thread and @timeout_thread.alive?
@timeout_thread = create_timeout_thread
Expand Down