belliottsmith commented on code in PR #3986: URL: https://github.com/apache/cassandra/pull/3986#discussion_r2018142634
########## src/java/org/apache/cassandra/service/accord/AccordExecutorLoops.java: ########## @@ -19,83 +19,70 @@ package org.apache.cassandra.service.accord; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.IntFunction; import accord.utils.Invariants; import org.agrona.collections.LongHashSet; -import org.apache.cassandra.concurrent.InfiniteLoopExecutor; -import org.apache.cassandra.concurrent.Interruptible; -import org.apache.cassandra.concurrent.Shutdownable; import org.apache.cassandra.service.accord.AccordExecutor.Mode; +import org.apache.cassandra.utils.concurrent.Condition; import static org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory; -import static org.apache.cassandra.concurrent.InfiniteLoopExecutor.Daemon.NON_DAEMON; -import static org.apache.cassandra.concurrent.InfiniteLoopExecutor.Interrupts.UNSYNCHRONIZED; -import static org.apache.cassandra.concurrent.InfiniteLoopExecutor.SimulatorSafe.SAFE; import static org.apache.cassandra.service.accord.AccordExecutor.Mode.RUN_WITH_LOCK; import static org.apache.cassandra.utils.Clock.Global.nanoTime; -class AccordExecutorInfiniteLoops implements Shutdownable +class AccordExecutorLoops { - private final Interruptible[] loops; + private final Thread[] loops; private final LongHashSet threadIds; - public AccordExecutorInfiniteLoops(Mode mode, int threads, IntFunction<String> name, Function<Mode, Interruptible.Task> tasks) + private final AtomicInteger running = new AtomicInteger(); + private final Condition terminated = Condition.newOneTimeCondition(); + + public AccordExecutorLoops(Mode mode, int threads, IntFunction<String> name, Function<Mode, Runnable> tasks) Review Comment: This is arbitrary and to me it still makes perfect sense to call these threads “loops” since that’s what they do - we could if you like rename the loop provider from tasks to loops, if it helps your mental model. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org