Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ruby/truffle/truffle/thread.rb
Original file line number Diff line number Diff line change
@@ -54,6 +54,8 @@ class ConditionVariable
# Creates a new ConditionVariable
#
def initialize
# Truffle: this Hash must never need a guest-language safepoint, or threads
# will get stuck while acquiring the Mutex in interrupt-never mode below.
@waiters = {}
@waiters_mutex = Mutex.new
end
@@ -75,9 +77,6 @@ def wait(mutex, timeout=nil)
end
ensure
@waiters_mutex.synchronize do
# Truffle: this Hash must never need a guest-language safepoint,
# or threads will get struck while acquiring the Mutex in
# interrupt-never mode.
@waiters.delete(Thread.current)
end
end

0 comments on commit e820f0f

Please sign in to comment.