internal void Update(object newValue, int newVersion, RubyModule newModule) { // Thread safety: // We need to write the version after we write the value. Otherwise the first time we initialize the cache with a value // another thread could read the value right after the version was set but before the Value field was initialized. Value = newValue; Condition = new VersionAndModule(newVersion, newModule.Id); }
internal void Update(bool newValue, int newVersion, RubyModule newModule) { // Thread safety: // We need to write the version after we write the value. Otherwise the first time we initialize the cache with a value // another thread could read the value right after the version was set but before the Value field was initialized. Value = newValue; Condition = new VersionAndModule(newVersion, newModule.Id); }