Lines Matching defs:Thread
40 // -t X .............. number of operations per thread
64 * Perform the action represented by this operation. Returns true if the thread should
65 * continue when executed by a runner (non-daemon) thread.
187 Thread.currentThread().getStackTrace();
207 Thread.sleep(SLEEP_TIME);
265 Thread.sleep((int)(Math.random() * 50 + 50));
293 Thread.sleep(SLEEP_TIME);
521 // the actual test later (including having a thread blocking on
530 // Let the main (current) thread acquire all permits from
531 // `semaphore`. Then create an auxiliary thread acquiring a
533 // available. Have the main thread release one permit, thus
534 // unblocking the second thread.
536 // Auxiliary thread.
537 Thread auxThread = new Thread("Aux") {
541 // that permit is released by the main thread.
547 throw new RuntimeException("Test set up failed in auxiliary thread");
552 // Main thread.
556 // Start the auxiliary thread and have it try to acquire a
559 // Synchronization: Wait until the auxiliary thread is
562 Thread.sleep(100);
567 // Synchronization: Wait for the auxiliary thread to die.
575 throw new RuntimeException("Test set up failed in main thread");
582 final Thread mainThread = Thread.currentThread();
585 // Each normal thread is going to do operationsPerThread
586 // operations. Each daemon thread will loop over all
590 // for each thread with the operations it is to perform. The
594 // Fill in the Operation[] array for each thread by laying
623 // Enable to dump operation counts per thread to make sure its
645 // Create the runners for each thread. The runner Thread
646 // ensures that thread that exit due to operation Exit will be
649 Thread[] runners = new Thread[numberOfThreads];
652 runners[r] = new Thread("Runner thread " + r) {
664 Thread thread = new Thread(ts, "Worker thread " + id);
665 thread.start();
666 thread.join();
670 "Thread exited for " + id + " with " +
677 // the Thread or from the DEBUG output.
678 // Note that the Thread creation may fail repeatedly,
687 // Interrupt the main thread, so that it can orderly shut down
695 // The notifier thread is a daemon just loops forever to wake
698 Thread notifier = new Thread("Notifier") {
714 Thread t = new Thread(daemon, "Daemon thread " + daemon.id);
770 Thread mainThread,
807 // Interrupt the main thread, so that it can orderly shut down
813 final Thread mainThread;