diff --git a/src/main/java/org/I0Itec/zkclient/ZkClient.java b/src/main/java/org/I0Itec/zkclient/ZkClient.java index 36a8f589..94f62583 100644 --- a/src/main/java/org/I0Itec/zkclient/ZkClient.java +++ b/src/main/java/org/I0Itec/zkclient/ZkClient.java @@ -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(); @@ -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);