changeset 4212:c6742d21853b

7042673: LockSupport.getBlocker(null) crashes Reviewed-by: chegar
author dl
date Mon, 09 May 2011 16:36:20 +0100
parents 31fbed875a6b
children 5dceeea3bb99
files src/share/classes/java/util/concurrent/locks/LockSupport.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/concurrent/locks/LockSupport.java	Mon May 09 15:58:25 2011 +0100
+++ b/src/share/classes/java/util/concurrent/locks/LockSupport.java	Mon May 09 16:36:20 2011 +0100
@@ -275,10 +275,14 @@
      * 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);
     }