class |
StatisticFieldLockInfoFactory
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.
|