List of usage examples for java.lang Thread currentThread
@HotSpotIntrinsicCandidate public static native Thread currentThread();
From source file:Main.java
public static String currentThreadName() { return Thread.currentThread().getName(); }
From source file:Main.java
public static long getThreadId() { Thread t = Thread.currentThread(); return t.getId(); }
From source file:Main.java
public static void updateThreadName(String name) { Thread.currentThread().setName(name); }
From source file:Main.java
private static StackTraceElement getCall() { return Thread.currentThread().getStackTrace()[4]; }
From source file:Main.java
public static void waitThis() { try {/*from w ww. j a v a 2 s . c o m*/ Thread.currentThread().wait(); } catch (InterruptedException e) { throw new RuntimeException(e); } }
From source file:Main.java
public static String getThreadId() { return String.valueOf(Thread.currentThread().getId()); }
From source file:Main.java
public static String getCallerNoPackageClassName() { return Thread.currentThread().getStackTrace()[2].getClassName().replaceAll(".*\\.", ""); }
From source file:Main.java
public static String getThreadInfo() { return "@[name=" + Thread.currentThread().getName() + ", id=" + Thread.currentThread().getId() + "]"; }
From source file:Main.java
public static StackTraceElement[] getStackTrace() { return Thread.currentThread().getStackTrace(); }
From source file:Main.java
public static ClassLoader getContextClassLoader() { return Thread.currentThread().getContextClassLoader(); }