Esempio n. 1
0
 public T Load(ShadowThread runningThread, Action <string> failTest)
 {
     if (_storeClock.AnyGreater(runningThread.ReleasesAcquired))
     {
         failTest($"Data race detected in load on thread {runningThread.Id} @ {runningThread.Clock}");
         return(default(T));
     }
     runningThread.IncrementClock();
     _loadClock[runningThread.Id] = runningThread.Clock;
     return(_data);
 }
Esempio n. 2
0
 public void Store(T data, ShadowThread runningThread, Action <string> failTest)
 {
     if (_loadClock.AnyGreater(runningThread.ReleasesAcquired) || _storeClock.AnyGreater(runningThread.ReleasesAcquired))
     {
         failTest($"Data race detected in store on thread {runningThread.Id} @ {runningThread.Clock}");
         return;
     }
     runningThread.IncrementClock();
     _storeClock[runningThread.Id] = runningThread.Clock;
     _data = data;
     return;
 }