MCPcopy Index your code
hub / github.com/apache/groovy / scheduleNext

Method scheduleNext

src/main/java/groovy/concurrent/Agent.java:348–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

346 }
347
348 private void scheduleNext() {
349 if (!queue.isEmpty() && active.compareAndSet(false, true)) {
350 delegate.execute(() -> {
351 Runnable task = queue.poll();
352 if (task != null) {
353 try {
354 task.run();
355 } finally {
356 active.set(false);
357 scheduleNext();
358 }
359 } else {
360 active.set(false);
361 }
362 });
363 }
364 }
365
366 /**
367 * Prevents further task submission.

Callers 1

executeMethod · 0.95

Calls 5

runMethod · 0.65
isEmptyMethod · 0.45
executeMethod · 0.45
pollMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected