src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SequentialScheduler.java
branchhttp-client-branch
changeset 55768 8674257c75ce
parent 55763 634d8e14c172
child 55973 4d9b002587db
equal deleted inserted replaced
55766:2136ad3694e4 55768:8674257c75ce
   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 }