本文整理了Java中sun.misc.Unsafe.unpark()
方法的一些代码示例,展示了Unsafe.unpark()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.unpark()
方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称: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;
内容来源于网络,如有侵权,请联系作者删除!