Package com.hazelcast.core

Examples of com.hazelcast.core.ILock.unlock()


        HazelcastInstance instance = createHazelcastInstance();
        ILock lock = instance.getLock(randomString());
        lockByOtherThread(lock);

        try {
            lock.unlock();
            fail();
        } catch (IllegalMonitorStateException expected) {
        }

        assertTrue(lock.isLocked());
View Full Code Here


        syncLatch.await();

        lock.lock();
        condition0.signal();
        lock.unlock();

        lock.lock();
        condition1.signal();
        lock.unlock();
View Full Code Here

        condition0.signal();
        lock.unlock();

        lock.lock();
        condition1.signal();
        lock.unlock();

        assertOpenEventually(latch);
    }

    @Test(timeout = 60000)
View Full Code Here

        syncLatch.await();

        lock.lock();
        condition.signalAll();
        lock.unlock();

        assertOpenEventually(latch);
    }

    @Test(timeout = 60000)
View Full Code Here

        syncLatch.await();

        lock.lock();
        condition0.signalAll();
        lock.unlock();

        assertTrueDelayed5sec(new AssertTask() {
            @Override
            public void run() throws Exception {
                assertEquals(latch.getCount(), 9);
View Full Code Here

        syncLatch.await();

        lock.lock();
        condition0.signalAll();
        lock.unlock();

        assertOpenEventually(latch);
    }

    @Test
View Full Code Here

        condition0.signalAll();
        lock0.unlock();

        lock1.lock();
        condition1.signalAll();
        lock1.unlock();

        assertOpenEventually(latch);
    }

    @Test(timeout = 60000)
View Full Code Here

                    if (lock.isLockedByCurrentThread()) {
                        count.incrementAndGet();
                    }
                } catch (InterruptedException ignored) {
                } finally {
                    lock.unlock();
                }
            }
        });
        t.start();
        Thread.sleep(1000);
View Full Code Here

        assertEquals(false, lock.isLocked());
        lock.lock();
        assertEquals(true, lock.isLocked());
        condition.signal();
        lock.unlock();
        t.join();
        assertEquals(2, count.get());
    }

    @Test(timeout = 60000)
View Full Code Here

                        if (lock.isLockedByCurrentThread()) {
                            count.incrementAndGet();
                        }
                    } catch (InterruptedException ignored) {
                    } finally {
                        lock.unlock();
                        finalLatch.countDown();
                    }

                }
            }).start();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.