...
In this compliant solution, ChangeValue()
obtains a lock on a static
private
Object
that is inaccessible to the caller.
Exceptions
LCK00-EX1: A class may violate this guideline, if all the following conditions are met:
⢠It sufficiently documents that callers must not pass objects of this class to untrusted code.
⢠The class does not invoke methods on objects of any untrusted classes that violate this guide-line directly or indirectly.
⢠The synchronization policy of the class is documented properly.
A client may use a class that violates this guideline, if all the following conditions are met:
⢠The class does not pass objects of this class to untrusted code.
⢠The class does not use any untrusted classes that violate this guideline directly or indirectly.
LCK00-EX2: If a superclass of the class documents that it supports client-side locking and syn-chronizes on its class object, the class can support client-side locking in the same way and docu-ment this policy.
LCK00-EX3: A package-private class may violate this guideline because its accessibility protects against untrusted callers. However, this condition should be documented explicitly so that trusted code within the same package does not reuse or change the lock object inadvertently.
...