Locks an object for serializing access in multithreaded applications.
ENTERLOCK
Object (expression)
Parts
- Object
-
Optional. If given, Object must be an expression that evaluates to an object (an instance of a reference type). Instances of value types are not allowed. The default value depends on where in the program the EnterLock appears.
- If it's in the body of an instance method, then the default value is *This.
- If it's in the body of a shared method, then the default value is *typeof(<current class>). This ensures serialization at a coarse level.