Skip to content

Commit

Permalink
Fixed task count in PoolSizeTest
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Apr 11, 2023
1 parent 7ab079f commit ef37323
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -66,9 +66,10 @@ void threadSafety() throws Exception {
AtomicInteger increases = new AtomicInteger();
AtomicInteger decreases = new AtomicInteger();
PoolSize poolSize = new PoolSize(100);
ExecutorService threadPool = Executors.newFixedThreadPool(100);
List<Callable<Void>> tasks = new ArrayList<>(100000);
for (int i = 0; i < 1000; i++) {
ExecutorService threadPool = Executors.newFixedThreadPool(500);
int taskCount = 10000;
List<Callable<Void>> tasks = new ArrayList<>(taskCount);
for (int i = 0; i < taskCount; i++) {
tasks.add(() -> {
poolSize.increment();
increases.incrementAndGet();
Expand Down

0 comments on commit ef37323

Please sign in to comment.