Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,41 @@ public synchronized void stop() {
}
}

/**
* Pauses sync on the cluster node.
*/
public synchronized void pauseSync() throws ClusterException {
try {
syncLock.acquire();
} catch (InterruptedException e) {
String msg = "Interrupted while waiting for mutex.";
throw new ClusterException(msg);
}
}

/**
* Attempts to pause sync on the cluster node waiting up to the provided msecs.
* @see EDU.oswego.cs.dl.util.concurrent.Mutex#attempt(long)
* @param msecs Number of milliseconds to wait
* @return True of lock was acquired, otherwise false
* @throws ClusterException
*/
public synchronized boolean pauseSync(long msecs) throws ClusterException {
try {
return syncLock.attempt(msecs);
} catch (InterruptedException e) {
String msg = "Interrupted while waiting for mutex.";
throw new ClusterException(msg);
}
}

/**
* Resumes sync the cluster node.
*/
public synchronized void resumeSync() {
syncLock.release();
}

/**
* Create an {@link UpdateEventChannel} for some workspace.
*
Expand Down