Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Mutex


    */
   public StreamingCallback(Global global, I_StreamingCallback callback, long waitForChunksTimeout, long waitForClientReturnTimeout, boolean useQueue)
      throws XmlBlasterException {
      this.callback = callback;
      this.global = global;
      this.mutex = new Mutex();
      String writerName = StreamingCallback.class.getName() + "-writer";
      synchronized(this.global) {
         this.writer = (Writer)this.global.getObjectEntry(writerName);
         if (this.writer == null) {
            this.writer = new Writer();
View Full Code Here


    /**
     * Creates query feed.
     */
    public QueryFeed()
    {
        syncParameterChange = new Mutex();

        baseTitle = null;
        queryType = null;
        parameter = null;
        renderTitle();
View Full Code Here

    }

    // The map of mutexes is keyed by the name of this persistent.
    // Try to find it first, If not found, create a new mutex and
    // add it to the map for this and future use.
    Mutex dbMutex = null;

    if ((dbMutex = (Mutex) dbLocks.get(dbKeyName)) == null)
    {
      if (log.isDebugEnabled())
      {
        log.debug("Creating new mutex for " + dbKeyName);
      }

      dbMutex = new Mutex();
      dbLocks.put(dbKeyName, dbMutex);
    }

    //Got handle to mutex, now acquire it
    try
    {
      dbMutex.acquire();
    }
    catch (InterruptedException ie)
    {
      throw new PersistenceException(ie);
    }
View Full Code Here

    {
      throw new PersistenceException("$keelNoDBLockMap");
    }

    String dbKeyName = getName();
    Mutex dbMutex = null;

    if ((dbMutex = (Mutex) dbLocks.get(dbKeyName)) == null)
    {
      throw new PersistenceException("DB lock mutex not found for " + dbKeyName);
    }

    dbMutex.release();

    if (log.isDebugEnabled())
    {
      log.debug("Released mutex lock for " + dbKeyName);
    }
View Full Code Here

        return p;
    }

    public void setup() throws ProtocolException {
        log = LogFactory.getLog(SocketProtocol.class.getName() + ":" + getNextConnectionId());
        sendMutex = new Mutex();
        headerBuffer = ByteBuffer.allocate(4);
        serviceReadMutex = new Object();
        serviceWriteMutex = new Object();

        if (address == null && acceptedSocketChannel == null) throw new IllegalStateException("No address set");
View Full Code Here

        return p;
    }

    public void setup() throws ProtocolException {
        log = LogFactory.getLog(SocketProtocol.class.getName() + ":" + getNextConnectionId());
        sendMutex = new Mutex();
        headerBuffer = ByteBuffer.allocate(4);
        serviceReadMutex = new Object();
        serviceWriteMutex = new Object();

        if (address == null && acceptedSocketChannel == null) throw new IllegalStateException("No address set");
View Full Code Here

    private final Sync readLock;
    private final Sync writeLock;

    public SynchornizedSynchChannel(SynchChannel next) {
        this(next, new Mutex(), new Mutex());
    }
View Full Code Here

public class SynchornizedAsynchChannel extends FilterAsynchChannel {

    private final Sync writeLock;

    public SynchornizedAsynchChannel(AsynchChannel next) {
        this(next, new Mutex());
    }
View Full Code Here

/*      */
/*      */ class MutexRNG extends SyncDelegatedRNG
/*      */ {
/*      */   public MutexRNG()
/*      */   {
/* 1950 */     super(new Mutex());
/*      */   }
View Full Code Here

/*     */   private final Object[] array;
/*     */
/*     */   public CVBuffer(int cap)
/*     */   {
/*  16 */     this.array = new Object[cap];
/*  17 */     this.mutex = new Mutex();
/*  18 */     this.notFull = new CondVar(this.mutex);
/*  19 */     this.notEmpty = new CondVar(this.mutex);
/*     */   }
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.Mutex

Copyright © 2018 www.massapicom. 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.