src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SequentialScheduler.java
equal
deleted
inserted
replaced
341 * of the handler. |
341 * of the handler. |
342 */ |
342 */ |
343 public void stop() { |
343 public void stop() { |
344 state.set(STOP); |
344 state.set(STOP); |
345 } |
345 } |
|
346 |
|
347 /** |
|
348 * Returns a new {@code SequentialScheduler} that executes the provided |
|
349 * {@code mainLoop} from within a {@link SynchronizedRestartableTask}. |
|
350 * |
|
351 * @apiNote |
|
352 * This is equivalent to calling |
|
353 * {@code new SequentialScheduler(new SynchronizedRestartableTask(mainloop));} |
|
354 * The main loop must not do any blocking operation. |
|
355 * |
|
356 * @param mainloop The main loop of the new sequential scheduler. |
|
357 * @return a new {@code SequentialScheduler} that executes the provided |
|
358 * {@code mainLoop} from within a {@link SynchronizedRestartableTask}. |
|
359 */ |
|
360 public static SequentialScheduler synchronizedScheduler(Runnable mainloop) { |
|
361 return new SequentialScheduler(new SynchronizedRestartableTask(mainloop)); |
|
362 } |
|
363 |
346 } |
364 } |