private static void checkPermission ( ) { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) security . checkPermission ( modifyThreadPermission ) ; }
If there is a security manager makes sure caller has permission to modify threads .