LockHelperExecuteOnce Method |
Ensures that the given action is executed only once if raised from multiple threads to prevent contention. Returns true, if current thread executed the action, otherwise returns false
Namespace: CMS.BaseAssembly: CMS.Base (in CMS.Base.dll) Version: 8.2.23
Syntax public static bool ExecuteOnce(
Action action,
Object lockObject,
bool waitForCompletion = true
)
Parameters
- action
- Type: SystemAction
Action to execute - lockObject
- Type: SystemObject
Object to use for locking context to ensure only one load - waitForCompletion (Optional)
- Type: SystemBoolean
If true, the other callers wait for completion of the action
Return Value
Type:
BooleanSee Also