Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java =================================================================== --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java (revision 464415) +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java (working copy) @@ -790,25 +790,29 @@ * @com.intel.drl.spec_ref */ public final void stop() { - stop(new ThreadDeath()); + synchronized (lock) { + if (isAlive()) { + stop(new ThreadDeath()); + } + } } /** * @com.intel.drl.spec_ref */ public final void stop(Throwable throwable) { + SecurityManager securityManager = System.getSecurityManager(); + if (securityManager != null) { + securityManager.checkAccess(this); + if (currentThread() != this || !(throwable instanceof ThreadDeath)) { + securityManager.checkPermission( + RuntimePermissionCollection.STOP_THREAD_PERMISSION); + } + } + if (throwable == null) { + throw new NullPointerException("The argument is null!"); + } synchronized (lock) { - if (throwable == null) { - throw new NullPointerException("The argument is null!"); - } - SecurityManager securityManager = System.getSecurityManager(); - if (securityManager != null) { - securityManager.checkAccess(this); - if (currentThread() != this) { - securityManager - .checkPermission(RuntimePermissionCollection.STOP_THREAD_PERMISSION); - } - } int status = VMThreadManager.stop(this, throwable); if (status != VMThreadManager.TM_ERROR_NONE) { throw new InternalError( @@ -816,7 +820,7 @@ } } } - + /** * @com.intel.drl.spec_ref */