Skip to content

Commit

Permalink
concurrent/cached_value.rb: Add comment about volatility
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Sep 18, 2018
1 parent d9244f7 commit 6e2017e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/i18n/tasks/concurrent/cached_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class CachedValue
def initialize(&computation)
@computation = computation
@mutex = Mutex.new

# Ruby instance variables are currently implicitly "volatile" in all major implementations, see:
# https://bugs.ruby-lang.org/issues/11539
#
# If the Ruby specification changes, this variable must be marked "volatile".
@result = NULL
end

Expand Down

0 comments on commit 6e2017e

Please sign in to comment.