Skip to content

Commit

Permalink
Fix positions on a couple of locks to be before the try
Browse files Browse the repository at this point in the history
...so they don't cause IllegalMonitorStateExceptions
  • Loading branch information
felipelb committed Apr 9, 2015
1 parent c3986fc commit 2939a93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/I0Itec/zkclient/ZkClient.java
Expand Up @@ -1085,8 +1085,8 @@ public Object call() throws Exception {
*/
public void connect(final long maxMsToWaitUntilConnected, Watcher watcher) throws ZkInterruptedException, ZkTimeoutException, IllegalStateException {
boolean started = false;
acquireEventLock();
try {
getEventLock().lockInterruptibly();
setShutdownTrigger(false);
_eventThread = new ZkEventThread(_connection.getServers());
_eventThread.start();
Expand All @@ -1112,8 +1112,8 @@ public void connect(final long maxMsToWaitUntilConnected, Watcher watcher) throw
}

public long getCreationTime(String path) {
getEventLock().lockInterruptibly();
try {
getEventLock().lockInterruptibly();
return _connection.getCreateTime(path);
} catch (KeeperException e) {
throw ZkException.create(e);
Expand Down

0 comments on commit 2939a93

Please sign in to comment.