Skip to content

Commit

Permalink
ugh
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Feb 16, 2024
1 parent 7d63a93 commit f1f889d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/datadog/core/remote/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ def wait_once(timeout = nil)
@deadline,
].compact.min

timeout = deadline ? deadline - now : nil
return :expired if timeout && timeout <= 0
_timeout = deadline ? deadline - now : nil
return :expired if _timeout && _timeout <= 0

# - starting with Ruby 3.2, ConditionVariable#wait returns nil on
# timeout and an integer otherwise
# - before Ruby 3.2, ConditionVariable returns itself
# so we have to rely on @lifted having been set
lifted = if RUBY_VERSION >= '3.2'
!!@condition.wait(@mutex, timeout)
!!@condition.wait(@mutex, _timeout)
else
@condition.wait(@mutex, timeout)
@condition.wait(@mutex, _timeout)
@lifted
end

Expand Down

0 comments on commit f1f889d

Please sign in to comment.