org.epics.ca.util.sync.NamedLockPattern Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ca Show documentation
Show all versions of ca Show documentation
Java CA client implementation using a new API (not using JCA).
package org.epics.ca.util.sync;
import java.util.HashMap;
import java.util.Map;
/**
* Named lock implementation (I named it "Named-lock pattern").
*
* // try to acquire named lock
* boolean lockAcquired = namedLocker.acquireSynchronizationObject(namedObject, getLockTimeout());
* if (lockAcquired)
* {
* try
* {
* // ... so sth here
* }
* finally
* {
* namedLocker.releaseSynchronizationObject(name);
* }
* }
* else
* {
* // .. failed to obtain synchronization lock for component 'namedObject', possible deadlock
* }
*
*/
public final class NamedLockPattern {
/**
* Map of (named) locks.
*/
private final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy