- All Implemented Interfaces:
- FieldLockInfoFactory
public class StatisticFieldLockInfoFactory
extends Object
implements FieldLockInfoFactory
a FieldLockInfo implementation with the following strategy:
- at each check, store the intersection of the current threads lock set
with the previous field lock set
- if the access was checked less than CHECK_THRESHOLD times, report the
field as unprotected
- if the field lock set doesn't become empty after CHECK_THRESHOLD, report
the field as protected
- as an optimization, raise the check level above the threshold if we
have a good probability that a current lock is a protection lock for this
field
- continue to check even after reaching the threshold, so that we
can at least report a violated assumption
NOTE there is a subtle problem: if we ever falsely assume lock protection
in a path that subsequently recycles the shared object (e.g. by leading
into an end state), we loose the assumption. If this is followed by
a backtrack and execution of a path that uses a conflicting assumption
(different or no lock), we will NOT detect potential races unless
vm.por.sync_detection.pindown is set (which has some runtime costs)