Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Condition.signal()


        long start = System.currentTimeMillis();
        Runnable doNothing = new Runnable() {
            public void run() {
                runLock.lock();
                try {
                    runCondition.signal();
                } finally {
                    runLock.unlock();
                }
            }
        };
View Full Code Here


            //wasteful. Also we should not release the news locks before firing
            //the events.
            ((News) changedNewsItem).acquireReadLockSpecial();
            eventRunnable.addCheckedUpdateEvent(createSaveEventTemplate(changedNewsItem));
          }
          condition.signal();
          setStateLock.unlock();
          save(changedNews);
          fDb.commit();
        } catch (Db4oException e) {
          throw new PersistenceException(e);
View Full Code Here

    {

      public void actionPerformed(ActionEvent e)
      {
        lock.lock();
        cont.signal();
        lock.unlock();
      }

    });
View Full Code Here

    entryLock.lock();
    try {
      Condition cond = lockMap.remove(offset);
      assert cond == condition;
      cond.signal();
    } finally {
      entryLock.unlock();
    }
  }
View Full Code Here

    // call with lock held!
    private Runnable takeTask() {
        final Condition removeCondition = this.removeCondition;
        Runnable task = queue.poll();
        if (task != null) {
            removeCondition.signal();
            return task;
        } else {
            final Condition enqueueCondition = this.enqueueCondition;
            final long start = System.currentTimeMillis();
            boolean intr = Thread.interrupted();
View Full Code Here

        long start = System.currentTimeMillis();
        Runnable doNothing = new Runnable() {
            public void run() {
                runLock.lock();
                try {
                    runCondition.signal();
                } finally {
                    runLock.unlock();
                }
            }
        };
View Full Code Here

        if( ex[0]!=null )
            throw ex[0];
        assertTrue(lock.hasWaiters(condition));

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

        UDIGTestUtil.inDisplayThreadWait(WAIT_LENGTH, new WaitCondition(){

            public boolean isTrue() {
View Full Code Here

            Display.getCurrent().asyncExec(new Runnable(){

                public void run() {
                    lock.lock();
                    try {
                        condition.signal();
                    } finally {
                        lock.unlock();
                    }
                }
View Full Code Here

                {
                    final Object result = entry.getValue() ;
                    final Condition condition = entry.getCondition() ;
                    if (condition != null)
                    {
                        condition.signal() ;
                    }
                    return result ;
                }
                return null ;
            }
View Full Code Here

                {
                    entry.setInactive() ;
                    final Condition condition = entry.getCondition() ;
                    if (condition != null)
                    {
                        condition.signal() ;
                    }
                    return entry ;
                }
                return null ;
            }
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.