Пример #1
0
 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);
 }
Пример #2
0
 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);
 }