Tabnine Logo
ca.odell.glazedlists.util.concurrent
Code IndexAdd Tabnine to your IDE (free)

How to use ca.odell.glazedlists.util.concurrent

Best Java code snippets using ca.odell.glazedlists.util.concurrent (Showing top 20 results out of 315)

origin: net.java.dev.glazedlists/glazedlists_java15

public void unlock() {
  Signaller s = endRead();
  if (s != null) s.signalWaiters();
}
origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Attempts to release this lock.
 *
 * <p> If the number of readers is now zero then the lock
 * is made available for write lock attempts.
 */
public void unlock() {
  switch (lock.sync.endRead()) {
    case Sync.NONE: return;
    case Sync.READER: lock.readerLock_.signalWaiters(); return;
    case Sync.WRITER: lock.writerLock_.signalWaiters(); return;
  }
}
origin: com.haulmont.thirdparty/glazedlists

public void unlock(){
  Signaller s = endWrite();
  if (s != null) s.signalWaiters();
}
origin: net.java.dev.glazedlists/glazedlists_java16

  /**
   * Return the lock used for writing.
   */
  @Override
  public Lock writeLock() {
    return sourceLock.writeLock();
  }
}
origin: net.java.dev.glazedlists/glazedlists_java15

  /**
   * Create a {@link ca.odell.glazedlists.util.concurrent.Lock}.
   *
   * <p>The default implementation returns an implementation that has been
   * derived from Doug Lea's <a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html">util.concurrent</a>.
   */
  public Lock createLock() {
    return new J2SE14ReadWriteLock().writeLock();
  }
}
origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Creates an empty {@link BasicEventList} with the given
 * <code>initialCapacity</code>.
 */
public BasicEventList(int initalCapacity) {
  this(initalCapacity, null, LockFactory.DEFAULT.createReadWriteLock());
}
origin: net.java.dev.glazedlists/glazedlists_java16

  @Override
  public Lock createLock() {
    return delegate.createLock();
  }
}
origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Queries the number of reentrant read holds on this lock by the
 * current thread.  A reader thread has a hold on a lock for
 * each lock action that is not matched by an unlock action.
 *
 * @return the number of holds on the read lock by the current thread,
 *         or zero if the read lock is not held by the current thread
 * @since 1.6
 */
public int getReadHoldCount() {
  return sync.getReadHoldCount();
}
origin: com.haulmont.thirdparty/glazedlists

protected synchronized boolean startWriteFromNewWriter() {
  boolean pass = startWrite();
  if (!pass) ++waitingWriters_;
  return pass;
}
origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Queries if the write lock is held by any thread. This method is
 * designed for use in monitoring system state, not for
 * synchronization control.
 *
 * @return {@code true} if any thread holds the write lock and
 *         {@code false} otherwise
 */
public boolean isWriteLocked() {
  return sync.isWriteLocked();
}
origin: com.haulmont.thirdparty/glazedlists

synchronized boolean startWriteFromWaitingWriter() {
  boolean pass = startWrite();
  if (pass) --waitingWriters_;
  return pass;
}
origin: com.haulmont.thirdparty/glazedlists

/**
 * Queries if this write lock is held by the current thread.
 * Identical in effect to {@link
 * java.util.concurrent.locks.ReentrantReadWriteLock#isWriteLockedByCurrentThread}.
 *
 * @return {@code true} if the current thread holds this lock and
 *       {@code false} otherwise
 * @since 1.6
 */
public boolean isHeldByCurrentThread() {
  return lock.sync.isWriteLockedByCurrentThread();
}
origin: com.haulmont.thirdparty/glazedlists

protected synchronized boolean startReadFromWaitingReader() {
  boolean pass = startRead();
  if (pass) --waitingReaders_;
  return pass;
}
origin: com.haulmont.thirdparty/glazedlists

/**
 * Attempts to release this lock.
 *
 * <p> If the number of readers is now zero then the lock
 * is made available for write lock attempts.
 */
public void unlock() {
  switch (lock.sync.endRead()) {
    case Sync.NONE: return;
    case Sync.READER: lock.readerLock_.signalWaiters(); return;
    case Sync.WRITER: lock.writerLock_.signalWaiters(); return;
  }
}
origin: net.java.dev.glazedlists/glazedlists_java15

public void unlock(){
  Signaller s = endWrite();
  if (s != null) s.signalWaiters();
}
origin: com.haulmont.thirdparty/glazedlists

  /**
   * Create a {@link ca.odell.glazedlists.util.concurrent.Lock}.
   *
   * <p>The default implementation returns an implementation that has been
   * derived from Doug Lea's <a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html">util.concurrent</a>.
   */
  public Lock createLock() {
    return new J2SE14ReadWriteLock().writeLock();
  }
}
origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Creates a {@link BasicEventList}.
 */
public BasicEventList() {
  this(LockFactory.DEFAULT.createReadWriteLock());
}
origin: com.haulmont.thirdparty/glazedlists

/**
 * Queries the number of reentrant read holds on this lock by the
 * current thread.  A reader thread has a hold on a lock for
 * each lock action that is not matched by an unlock action.
 *
 * @return the number of holds on the read lock by the current thread,
 *         or zero if the read lock is not held by the current thread
 * @since 1.6
 */
public int getReadHoldCount() {
  return sync.getReadHoldCount();
}
origin: net.java.dev.glazedlists/glazedlists_java15

protected synchronized boolean startWriteFromWaitingWriter() {
  boolean pass = startWrite();
  if (pass) --waitingWriters_;
  return pass;
}
origin: com.haulmont.thirdparty/glazedlists

  /** Recreate an appropriate lock implementation when deserialized on the target JVM. */
  private Object readResolve() throws ObjectStreamException {
    return LockFactory.DEFAULT.createReadWriteLock();
  }
}
ca.odell.glazedlists.util.concurrent

Most used classes

  • Lock
    A lock is a tool for controlling access to a shared resource by multiple threads.This interface is a
  • ReadWriteLock
    A ReadWriteLock maintains a pair of associated locks, one for read-only operations and one for writi
  • LockFactory
    This factory provides an implementation of Lock that is optimized for the current Java Virtual Machi
  • J2SE14LockFactory
    An implementation of ca.odell.glazedlists.util.concurrent.LockFactory that has been derived from Dou
  • J2SE14ReadWriteLock$NonfairSync
    Nonfair version of Sync
  • J2SE14ReadWriteLock$Sync,
  • J2SE14ReadWriteLock$WriteLock,
  • J2SE14ReadWriteLock,
  • ReentrantWriterPreferenceReadWriteLock,
  • WriterPreferenceReadWriteLock$ReaderLock,
  • WriterPreferenceReadWriteLock$Signaller,
  • WriterPreferenceReadWriteLock$WriterLock,
  • WriterPreferenceReadWriteLock,
  • J2SE50LockFactory,
  • J2SE50ReadWriteLock,
  • LockAdapter,
  • SerializedReadWriteLock
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now