sun.misc.Unsafe.unpark()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中sun.misc.Unsafe.unpark()方法的一些代码示例,展示了Unsafe.unpark()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.unpark()方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:unpark

Unsafe.unpark介绍

[英]Unparks the given object, which must be a Thread.

See java.util.concurrent.locks.LockSupport for more in-depth information of the behavior of this method.
[中]解析给定对象,该对象必须是线程。
参见java。util。同时发生的锁。LockSupport可获取此方法行为的更深入信息。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Makes available the permit for the given thread, if it
 * was not already available.  If the thread was blocked on
 * {@code park} then it will unblock.  Otherwise, its next call
 * to {@code park} is guaranteed not to block. This operation
 * is not guaranteed to have any effect at all if the given
 * thread has not been started.
 *
 * @param thread the thread to unpark, or {@code null}, in which case
 *        this operation has no effect
 */
public static void unpark(Thread thread) {
  if (thread != null)
    unsafe.unpark(thread);
}

代码示例来源:origin: h2oai/h2o-2

/**
 * If this owned and is not already interrupted, try to
 * interrupt and/or unpark, ignoring exceptions.
 */
final void interruptOwner() {
  Thread wt, p;
  if ((wt = owner) != null && !wt.isInterrupted()) {
    try {
      wt.interrupt();
    } catch (SecurityException ignore) {
    }
  }
  if ((p = parker) != null)
    U.unpark(p);
}

代码示例来源:origin: robovm/robovm

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
if (--n <= 0)
  break;

代码示例来源:origin: com.typesafe.akka/akka-actor_2.11

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
if (--n <= 0)
  break;

代码示例来源:origin: com.typesafe.akka/akka-actor

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
if (--n <= 0)
  break;

代码示例来源:origin: com.typesafe.akka/akka-actor_2.12

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
if (--n <= 0)
  break;

代码示例来源:origin: h2oai/h2o-2

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);                // activate and release
break;

代码示例来源:origin: robovm/robovm

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
break;

代码示例来源:origin: com.typesafe.akka/akka-actor_2.11

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
break;

代码示例来源:origin: com.typesafe.akka/akka-actor_2.12

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
break;

代码示例来源:origin: com.typesafe.akka/akka-actor

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
break;

代码示例来源:origin: robovm/robovm

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
return true;   // replace with idle worker

代码示例来源:origin: com.typesafe.akka/akka-actor_2.11

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
return true;   // replace with idle worker

代码示例来源:origin: com.typesafe.akka/akka-actor

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
return true;   // replace with idle worker

代码示例来源:origin: com.typesafe.akka/akka-actor_2.12

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
return true;   // replace with idle worker

代码示例来源:origin: h2oai/h2o-2

w.eventCount = (e + E_SEQ) & E_MASK;
if ((p = w.parker) != null)
  U.unpark(p);
return true;

代码示例来源:origin: robovm/robovm

Thread w = q.parked;
if (w != null)
  U.unpark(w);
return v;

代码示例来源:origin: h2oai/h2o-2

w.runState = -1;
if ((p = w.parker) != null)
  U.unpark(p);

代码示例来源:origin: robovm/robovm

v.eventCount = (e + E_SEQ) & E_MASK;
if ((p = v.parker) != null)
  U.unpark(p);
break;

代码示例来源:origin: com.typesafe.akka/akka-actor_2.11

v.eventCount = (e + E_SEQ) & E_MASK;
if ((p = v.parker) != null)
  U.unpark(p);
break;

相关文章

Unsafe类方法