164165166167168169170171172173174
HazelcastInstance client = HazelcastClient.newHazelcastClient(clientConfig); final ILock lock = client.getLock("lock"); for (int k = 0; k < 10; k++) { lock.lock(); try { Thread.sleep(100); } finally { lock.unlock(); }
172173174175176177178179180181182
} finally { lock.unlock(); } } lock.lock(); hz1.shutdown(); lock.unlock(); } @Test