Package com.hazelcast.core

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


        }

        awaitLatch.await(1, TimeUnit.MINUTES);
        lock.lock();
        condition.signalAll();
        lock.unlock();
        finalLatch.await(1, TimeUnit.MINUTES);
        assertEquals(k * 2, count.get());
    }

    /**
 
View Full Code Here


                            } catch (InterruptedException ignored) {
                            } catch (IllegalStateException e) {
                                errorRef.set(e);
                                running.set(false);
                            } finally {
                                lock.unlock();
                            }
                        }
                    } finally {
                        finalLatch.countDown();
                    }
View Full Code Here

        syncLatch.await();

        lock.lock();
        condition.signal();
        lock.unlock();

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

        final CountDownLatch latch = new CountDownLatch(1);

        lock.lock();
        condition.signal();
        lock.unlock();

        createThreadWaitsForCondition(latch, lock, condition, null).start();
        // if the thread is still waiting, then the signal is not stored.
        assertFalse(latch.await(3000, TimeUnit.MILLISECONDS));
    }
View Full Code Here

        }).start();

        sleepSeconds(1);
        lock.lock();
        condition.signal();
        lock.unlock();
    }

    @Test(timeout = 60000)
    public void testAwaitUntil_whenFail() throws InterruptedException {
        HazelcastInstance instance = createHazelcastInstance();
View Full Code Here

        }).start();

        sleepSeconds(1);
        lock.lock();
        condition.signal();
        lock.unlock();
    }

    // See #3262
    @Test(timeout = 60000)
    @Ignore
View Full Code Here

                try {
                    condition.await();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } finally {
                    lock.unlock();
                }
                signalCounter.incrementAndGet();
            }
        });
        t.start();
View Full Code Here

        }).start();

        lock.lock();
        latch.countDown();
        condition.await();
        lock.unlock();
    }

    @Test(timeout = 60000, expected = HazelcastInstanceNotActiveException.class)
    public void testShutDownNode_whenOtherWaitingOnConditionAwait() throws InterruptedException {
        final TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(2);
View Full Code Here

        try {
            latch.countDown();
            condition.await();
        } catch (InterruptedException e) {
        }
        lock.unlock();
    }


    @Test
    @Ignore // https://github.com/hazelcast/hazelcast/issues/2272
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.