Java Code Examples for java.util.concurrent.locks.LockSupport.getBlocker()

The following are Jave code examples for showing how to use getBlocker() of the java.util.concurrent.locks.LockSupport class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: guava-mock   File: AbstractFutureTest.java   View Source Code Vote up 5 votes
void awaitWaiting() {
  while (LockSupport.getBlocker(this) != future) {
    if (getState() == State.TERMINATED) {
      throw new RuntimeException("Thread exited");
    }
    Thread.yield();
  }
}
 
Example 2
Project: guava-mock   File: AbstractFutureTest.java   View Source Code Vote up 5 votes
void awaitWaiting() {
  while (LockSupport.getBlocker(this) != future) {
    if (getState() == State.TERMINATED) {
      throw new RuntimeException("Thread exited");
    }
    Thread.yield();
  }
}
 
Example 3
Project: openjdk-jdk10   File: LockSupportTest.java   View Source Code Vote up 5 votes
/**
 * getBlocker(null) throws NullPointerException
 */
public void testGetBlockerNull() {
    try {
        LockSupport.getBlocker(null);
        shouldThrow();
    } catch (NullPointerException success) {}
}
 
Example 4
Project: googles-monorepo-demo   File: AbstractFutureTest.java   View Source Code Vote up 5 votes
void awaitWaiting() {
  while (LockSupport.getBlocker(this) != future) {
    if (getState() == State.TERMINATED) {
      throw new RuntimeException("Thread exited");
    }
    Thread.yield();
  }
}
 
Example 5
Project: googles-monorepo-demo   File: AbstractFutureTest.java   View Source Code Vote up 5 votes
void awaitWaiting() {
  while (LockSupport.getBlocker(this) != future) {
    if (getState() == State.TERMINATED) {
      throw new RuntimeException("Thread exited");
    }
    Thread.yield();
  }
}