cz.vutbr.fit.racedetector
Class ARInfo

java.lang.Object
  extended by cz.vutbr.fit.racedetector.ARInfo

public class ARInfo
extends java.lang.Object

This class represents detected atomicity violation which could lead to a data race. It contain all necessary information that can be used for tracking what happened.

Author:
zdenek

Nested Class Summary
 class ARInfo.ProblemAccess
          This class represents the problematic access which was detected when someone else was in atomicity section of this variable.
 
Field Summary
 Atomicity atomicity
          Atomicity section which was disturbed.
 
Constructor Summary
ARInfo(Atomicity at)
          Constructor.
 
Method Summary
 boolean addProblemAccess(java.lang.String location, RaceDetector.Operation op)
          Adds a new ProblemAccess to this race report only if the current thread is different from one which enters the atomic section.
 boolean equals(java.lang.Object arrace)
          Returns true if the given object is of type ARRace and atomicity and byThread are the same.
 int hashCode()
          Returns hashCode of this Object which is actually the hash code of the program location.
 ARInfo.ProblemAccess isTrueRace(RaceDetector.Operation endOp)
          Returns true if the given atomicity ending operation means that it was a true race.
 java.lang.String printAtomViolatReport(ARInfo.ProblemAccess pAcc)
          Produce the warning that race has been detected.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

atomicity

public final Atomicity atomicity
Atomicity section which was disturbed.

Constructor Detail

ARInfo

public ARInfo(Atomicity at)
Constructor.

Parameters:
at - Atomicity.
Method Detail

addProblemAccess

public boolean addProblemAccess(java.lang.String location,
                                RaceDetector.Operation op)
Adds a new ProblemAccess to this race report only if the current thread is different from one which enters the atomic section.

Parameters:
location -
op -
Returns:
true if the current thread is not the one which enters the atomic section - possible atomicity violation detected.

printAtomViolatReport

public java.lang.String printAtomViolatReport(ARInfo.ProblemAccess pAcc)
Produce the warning that race has been detected.


isTrueRace

public ARInfo.ProblemAccess isTrueRace(RaceDetector.Operation endOp)
Returns true if the given atomicity ending operation means that it was a true race. True race is is in this case caused by unserializable interleavings.

Problematic interleavings are (based on AVIO paper):

Parameters:
endOp -
Returns:
the race is true race

equals

public boolean equals(java.lang.Object arrace)
Returns true if the given object is of type ARRace and atomicity and byThread are the same. (other fields are not compared)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns hashCode of this Object which is actually the hash code of the program location.

Overrides:
hashCode in class java.lang.Object