Example usage for java.lang Thread checkAccess

List of usage examples for java.lang Thread checkAccess

Introduction

In this page you can find the example usage for java.lang Thread checkAccess.

Prototype

public final void checkAccess() 

Source Link

Document

Determines if the currently running thread has permission to modify this thread.

Usage

From source file:Main.java

public static void main(String args[]) {

    new ThreadClass("A");
    Thread t = Thread.currentThread();

    try {/*from w  ww.j av a2  s  .  c o m*/
        t.checkAccess();
        System.out.println("You have permission to modify");
    } catch (Exception e) {
        System.out.println(e);
    }
}