提交 d38fcc7c 编写于 作者: D dl

7042673: LockSupport.getBlocker(null) crashes

Reviewed-by: chegar
上级 0f8b06ed
......@@ -275,10 +275,14 @@ public class LockSupport {
* snapshot -- the thread may have since unblocked or blocked on a
* different blocker object.
*
* @param t the thread
* @return the blocker
* @throws NullPointerException if argument is null
* @since 1.6
*/
public static Object getBlocker(Thread t) {
if (t == null)
throw new NullPointerException();
return unsafe.getObjectVolatile(t, parkBlockerOffset);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册