congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Thread.holdsLock
Code IndexAdd Tabnine to your IDE (free)

How to use
holdsLock
method
in
java.lang.Thread

Best Java code snippets using java.lang.Thread.holdsLock (Showing top 20 results out of 2,934)

origin: square/okhttp

void put(RealConnection connection) {
 assert (Thread.holdsLock(this));
 if (!cleanupRunning) {
  cleanupRunning = true;
  executor.execute(cleanupRunnable);
 }
 connections.add(connection);
}
origin: google/guava

@Override
public boolean isEmpty() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.isEmpty();
}
origin: google/guava

@Override
public boolean add(E element) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.add(element);
}
origin: square/okhttp

@Override public void write(Buffer source, long byteCount) throws IOException {
 assert (!Thread.holdsLock(Http2Stream.this));
 sendBuffer.write(source, byteCount);
 while (sendBuffer.size() >= EMIT_BUFFER_SIZE) {
  emitFrame(false);
 }
}
origin: google/guava

@Override
public K getKey() {
 assertTrue(Thread.holdsLock(mutex));
 return super.getKey();
}
origin: google/guava

@Override
public int hashCode() {
 assertTrue(Thread.holdsLock(mutex));
 return super.hashCode();
}
origin: google/guava

@Override
public V remove(Object rowKey, Object columnKey) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.remove(rowKey, columnKey);
}
origin: google/guava

@Override
public E element() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.element();
}
origin: google/guava

@Override
public boolean containsAll(Collection<?> collection) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.containsAll(collection);
}
origin: google/guava

@Override
public int size() {
 assertTrue(Thread.holdsLock(mutex));
 return super.size();
}
origin: google/guava

@Override
public Entry<K, V> ceilingEntry(K key) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().ceilingEntry(key);
}
origin: google/guava

@Override
public NavigableSet<K> descendingKeySet() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().descendingKeySet();
}
origin: google/guava

@Override
public Entry<K, V> floorEntry(K key) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().floorEntry(key);
}
origin: google/guava

@Override
public Entry<K, V> higherEntry(K key) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().higherEntry(key);
}
origin: google/guava

@Override
public NavigableSet<K> navigableKeySet() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().navigableKeySet();
}
origin: google/guava

@Override
public boolean equals(@Nullable Object o) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.equals(o);
}
origin: google/guava

@Override
public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().tailSet(fromElement, inclusive);
}
origin: google/guava

@Override
public Comparator<? super E> comparator() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate().comparator();
}
origin: google/guava

@Override
public boolean add(@Nullable E o) {
 assertTrue(Thread.holdsLock(mutex));
 return super.add(o);
}
origin: google/guava

@Override
public boolean remove(@Nullable Object o) {
 assertTrue(Thread.holdsLock(mutex));
 return super.remove(o);
}
java.langThreadholdsLock

Javadoc

Returns true if and only if the current thread holds the monitor lock on the specified object.

This method is designed to allow a program to assert that the current thread already holds a specified lock:

 
assert Thread.holdsLock(obj); 

Popular methods of Thread

  • currentThread
  • sleep
    Causes the currently executing thread to sleep (temporarily cease execution) for the specified numbe
  • <init>
    Constructs a new Thread with no Runnable object, the given name and belonging to the ThreadGroup pas
  • start
    Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread
  • getContextClassLoader
    Returns the context ClassLoader for this Thread. The context ClassLoader is provided by the creator
  • interrupt
    Interrupts this thread. Unless the current thread is interrupting itself, which is always permitted,
  • setDaemon
    Marks this thread as either a #isDaemon thread or a user thread. The Java Virtual Machine exits when
  • getName
    Returns this thread's name.
  • join
    Waits at most millis milliseconds plus nanos nanoseconds for this thread to die. This implementatio
  • setContextClassLoader
    Sets the context ClassLoader for this Thread. The context ClassLoader can be set when a thread is cr
  • setName
    Changes the name of this thread to be equal to the argumentname. First the checkAccess method of thi
  • interrupted
    Tests whether the current thread has been interrupted. Theinterrupted status of the thread is cleare
  • setName,
  • interrupted,
  • getStackTrace,
  • getId,
  • isInterrupted,
  • isAlive,
  • setPriority,
  • yield,
  • getThreadGroup,
  • getPriority

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JPanel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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