Home | History | Annotate | Download | only in provider

Lines Matching defs:thread

51     private void waitUntilDestruction(SelfDestructiveThread thread, long timeoutMs) {
52 if (!thread.isRunning()) {
60 Thread.sleep(timeSliceMs);
64 if (!thread.isRunning()) {
68 throw new RuntimeException("Timeout for waiting thread destruction.");
79 Thread.sleep(TimeUnit.NANOSECONDS.toMillis(deadlineNanoTime - now));
89 final SelfDestructiveThread thread = new SelfDestructiveThread(
91 thread.postAndWait(new Callable<Object>() {
97 waitUntilDestruction(thread, DEFAULT_TIMEOUT);
98 assertFalse(thread.isRunning());
104 final SelfDestructiveThread thread = new SelfDestructiveThread(
106 Integer generation = thread.postAndWait(new Callable<Integer>() {
109 return thread.getGeneration();
113 waitUntilDestruction(thread, DEFAULT_TIMEOUT);
114 Integer nextGeneration = thread.postAndWait(new Callable<Integer>() {
117 return thread.getGeneration();
127 final SelfDestructiveThread thread = new SelfDestructiveThread(
129 Integer generation = thread.postAndWait(new Callable<Integer>() {
132 return thread.getGeneration();
136 Integer nextGeneration = thread.postAndWait(new Callable<Integer>() {
139 return thread.getGeneration();
143 waitUntilDestruction(thread, DEFAULT_TIMEOUT);
151 final SelfDestructiveThread thread = new SelfDestructiveThread(
153 Integer generation = thread.postAndWait(new Callable<Integer>() {
156 return thread.getGeneration();
162 // Less than renewal duration, so that the same thread must be used.
164 Integer nextGeneration = thread.postAndWait(new Callable<Integer>() {
167 return thread.getGeneration();
173 waitUntilDestruction(thread, DEFAULT_TIMEOUT);
179 final SelfDestructiveThread thread = new SelfDestructiveThread(
184 thread.postAndWait(new Callable<Object>() {
266 final SelfDestructiveThread thread = new SelfDestructiveThread(
271 thread.postAndReply(callable, reply);