List of usage examples for java.lang Object subclass-usage
From source file InterruptReset.java
public class InterruptReset extends Object { public static void main(String[] args) { System.out.println("Thread.interrupted()=" + Thread.interrupted()); Thread.currentThread().interrupt(); System.out.println("Thread.interrupted()=" + Thread.interrupted()); System.out.println("Thread.interrupted()=" + Thread.interrupted());
From source file PendingInterrupt.java
public class PendingInterrupt extends Object { public static void main(String[] args) { Thread.currentThread().interrupt(); long startTime = System.currentTimeMillis(); try {
From source file SleepInterrupt.java
public class SleepInterrupt extends Object implements Runnable { public void run() { try { System.out.println("in run() - sleep for 20 seconds"); Thread.sleep(20000); System.out.println("in run() - woke up");
From source file GetPriority.java
public class GetPriority extends Object { private static Runnable makeRunnable() { Runnable r = new Runnable() { public void run() { for (int i = 0; i < 5; i++) { Thread t = Thread.currentThread();
From source file PiInterrupt.java
public class PiInterrupt extends Object implements Runnable { private double latestPiEstimate; public void run() { try { System.out.println("for comparison, Math.PI=" + Math.PI);
From source file AlternateStop.java
public class AlternateStop extends Object implements Runnable { private volatile boolean stopRequested; private Thread runThread; public void run() {
From source file StaticBlock.java
public class StaticBlock extends Object { public static synchronized void staticA() { System.out.println("entering staticA()"); try { Thread.sleep(5000);
From source file SelfRunThreadTemplate.java
public class SelfRunThreadTemplate extends Object implements Runnable { private Thread internalThread; private volatile boolean noStopRequested; public SelfRunThreadTemplate() { // add your code here ...
From source file StaticSync.java
public class StaticSync extends Object { private static int nextSerialNum = 10001; public static synchronized int getNextSerialNum() { int sn = nextSerialNum;
From source file JoinDemo.java
public class JoinDemo extends Object { public static Thread createThread(String name, long napTime) { final long sleepTime = napTime; Runnable r = new Runnable() { public void run() {