Home
last modified time | relevance | path

Searched refs:pool (Results 1 – 25 of 39) sorted by relevance

12

/libcore/luni/src/test/java/libcore/java/util/concurrent/
DForkJoinPoolTest.java38 final ForkJoinPool pool = new ForkJoinPool(); in testSubmit() local
39 try (ExecutorServiceAutoCloseable cleaner = new ExecutorServiceAutoCloseable(pool)) { in testSubmit()
41 ForkJoinTask task = pool.submit(() -> result.addAndGet(42), result); in testSubmit()
51 final ForkJoinPool pool = new ForkJoinPool(); in testGetRunningThreadCount() local
52 try (ExecutorServiceAutoCloseable cleaner = new ExecutorServiceAutoCloseable(pool)) { in testGetRunningThreadCount()
53 assertEquals(0, pool.getRunningThreadCount()); in testGetRunningThreadCount()
58 ForkJoinTask task = pool.submit(new Runnable() { in testGetRunningThreadCount()
70 assertEquals(1, pool.getRunningThreadCount()); in testGetRunningThreadCount()
73 pool.awaitTermination(2000, TimeUnit.MILLISECONDS); in testGetRunningThreadCount()
74 assertEquals(0, pool.getRunningThreadCount()); in testGetRunningThreadCount()
[all …]
DForkJoinTaskTest.java43 final ForkJoinPool pool = new ForkJoinPool(1); in testAdaptToRunnableWithResult() local
44 try (ExecutorServiceAutoCloseable cleaner = new ExecutorServiceAutoCloseable(pool)) { in testAdaptToRunnableWithResult()
45 pool.execute(task); in testAdaptToRunnableWithResult()
62 final ForkJoinPool pool = new ForkJoinPool(1); in testAdaptToCallable() local
63 try (ExecutorServiceAutoCloseable cleaner = new ExecutorServiceAutoCloseable(pool)) { in testAdaptToCallable()
64 pool.execute(task); in testAdaptToCallable()
81 final ForkJoinPool pool = new ForkJoinPool(1); in testAdaptToCallableThrowsException() local
82 try (ExecutorServiceAutoCloseable cleaner = new ExecutorServiceAutoCloseable(pool)) { in testAdaptToCallableThrowsException()
83 pool.execute(task); in testAdaptToCallableThrowsException()
DCountedCompleterTest.java137 final ForkJoinPool pool; in completeAllChildren() field in CountedCompleterTest.MainTask
141 MainTask(ForkJoinPool pool, int lo, int hi) { in completeAllChildren() argument
143 this.pool = pool; in completeAllChildren()
157 pool.submit(new Task(this, idx)); in completeAllChildren()
174 ForkJoinPool pool = new ForkJoinPool(1); in completeAllChildren() local
175 MainTask task = new MainTask(pool, 0, array.length); in completeAllChildren()
176 pool.submit(task); in completeAllChildren()
/libcore/ojluni/src/main/java/java/util/concurrent/
DForkJoinWorkerThread.java66 final ForkJoinPool pool; // the pool this thread works in field in ForkJoinWorkerThread
72 ForkJoinWorkerThread(ThreadGroup group, ForkJoinPool pool, in ForkJoinWorkerThread() argument
74 super(group, null, pool.nextWorkerThreadName(), 0L); in ForkJoinWorkerThread()
75 UncaughtExceptionHandler handler = (this.pool = pool).ueh; in ForkJoinWorkerThread()
92 /* TODO: protected */ ForkJoinWorkerThread(ThreadGroup group, ForkJoinPool pool) { in ForkJoinWorkerThread() argument
93 this(group, pool, false, false); in ForkJoinWorkerThread()
102 protected ForkJoinWorkerThread(ForkJoinPool pool) { in ForkJoinWorkerThread() argument
103 this(null, pool, false, false); in ForkJoinWorkerThread()
112 return pool; in getPool()
159 ForkJoinPool p = pool; in run()
[all …]
DForkJoinTask.java399 private int awaitDone(ForkJoinPool pool, boolean ran, in awaitDone() argument
406 p = wt.pool; in awaitDone()
407 if (pool == null) in awaitDone()
408 pool = p; in awaitDone()
409 if (internal = (pool == p)) in awaitDone()
415 if (pool == null) in awaitDone()
416 pool = p; in awaitDone()
417 if (pool == p && p != null) in awaitDone()
456 if (fail || (fail = (pool != null && pool.mode < 0))) in awaitDone()
489 if (pool != null && uncompensate) in awaitDone()
[all …]
DForkJoinPool.java795 public ForkJoinWorkerThread newThread(ForkJoinPool pool); in newThread() argument
811 public final ForkJoinWorkerThread newThread(ForkJoinPool pool) { in newThread() argument
815 return new ForkJoinWorkerThread(null, pool, true, false); in newThread()
839 public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
844 new ForkJoinWorkerThread(null, pool, true, true):
846 InnocuousForkJoinWorkerThread(pool); }},
974 final void push(ForkJoinTask<?> task, ForkJoinPool pool) {
977 if (a != null && pool != null && (cap = a.length) > 0) {
982 pool.signalWork(); // signal if was empty or resized
2196 wt.pool == this)
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DAsynchronousChannelGroupImpl.java55 private final ThreadPool pool; field in AsynchronousChannelGroupImpl
73 ThreadPool pool) in AsynchronousChannelGroupImpl() argument
76 this.pool = pool; in AsynchronousChannelGroupImpl()
78 if (pool.isFixedThreadPool()) { in AsynchronousChannelGroupImpl()
92 return pool.executor(); in executor()
96 return pool.isFixedThreadPool(); in isFixedThreadPool()
101 return pool.poolSize(); in fixedThreadCount()
103 return pool.poolSize() + internalThreadCount; in fixedThreadCount()
136 if (pool.poolSize() > 0) {
139 for (int i=0; i<pool.poolSize(); i++) {
[all …]
DPort.java57 Port(AsynchronousChannelProvider provider, ThreadPool pool) { in Port() argument
58 super(provider, pool); in Port()
DEPollPort.java83 EPollPort(AsynchronousChannelProvider provider, ThreadPool pool) in EPollPort() argument
86 super(provider, pool); in EPollPort()
DSimpleAsynchronousFileChannelImpl.java68 ThreadPool pool) in open() argument
71 ExecutorService executor = (pool == null) ? in open()
72 DefaultExecutorHolder.defaultExecutor : pool.executor(); in open()
/libcore/jsr166-tests/src/test/java/jsr166/
DForkJoinTask8Test.java80 private void testInvokeOnPool(ForkJoinPool pool, RecursiveAction a) { in testInvokeOnPool() argument
81 try (PoolCleaner cleaner = cleaner(pool)) { in testInvokeOnPool()
89 assertNull(pool.invoke(a)); in testInvokeOnPool()
388 public void testInvoke(ForkJoinPool pool) {
395 testInvokeOnPool(pool, a);
409 public void testQuietlyInvoke(ForkJoinPool pool) {
416 testInvokeOnPool(pool, a);
428 public void testForkJoin(ForkJoinPool pool) {
436 testInvokeOnPool(pool, a);
448 public void testForkGet(ForkJoinPool pool) {
[all …]
DJSR166TestCase.java855 private final ExecutorService pool; field in JSR166TestCase.PoolCleaner
856 public PoolCleaner(ExecutorService pool) { this.pool = pool; } in PoolCleaner() argument
857 public void close() { joinPool(pool); } in close()
865 public PoolCleanerWithReleaser(ExecutorService pool, Runnable releaser) { in PoolCleanerWithReleaser() argument
866 super(pool); in PoolCleanerWithReleaser()
878 PoolCleaner cleaner(ExecutorService pool) { in cleaner() argument
879 return new PoolCleaner(pool); in cleaner()
882 PoolCleaner cleaner(ExecutorService pool, Runnable releaser) { in cleaner() argument
883 return new PoolCleanerWithReleaser(pool, releaser); in cleaner()
886 PoolCleaner cleaner(ExecutorService pool, CountDownLatch latch) { in cleaner() argument
[all …]
DCollection8Test.java82 final ExecutorService pool = Executors.newCachedThreadPool(); in testForEachConcurrentStressTest() local
83 try (PoolCleaner cleaner = cleaner(pool, done)) { in testForEachConcurrentStressTest()
95 f1 = pool.submit(checkElt); in testForEachConcurrentStressTest()
96 f2 = pool.submit(addRemove); in testForEachConcurrentStressTest()
DDoubleAccumulatorTest.java127 final ExecutorService pool = Executors.newCachedThreadPool(); in testAccumulateAndGetMT() local
131 pool.execute(new AccTask(a, phaser, incs)); in testAccumulateAndGetMT()
137 pool.shutdown(); in testAccumulateAndGetMT()
DLongAccumulatorTest.java127 final ExecutorService pool = Executors.newCachedThreadPool(); in testAccumulateAndGetMT() local
131 pool.execute(new AccTask(a, phaser, incs)); in testAccumulateAndGetMT()
137 pool.shutdown(); in testAccumulateAndGetMT()
DDoubleAdderTest.java139 final ExecutorService pool = Executors.newCachedThreadPool(); in testAddAndSumMT() local
143 pool.execute(new AdderTask(a, barrier, incs)); in testAddAndSumMT()
149 pool.shutdown(); in testAddAndSumMT()
DLongAdderTest.java162 final ExecutorService pool = Executors.newCachedThreadPool(); in testAddAndSumMT() local
166 pool.execute(new AdderTask(a, barrier, incs)); in testAddAndSumMT()
172 pool.shutdown(); in testAddAndSumMT()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DForkJoinTask8Test.java103 private void testInvokeOnPool(ForkJoinPool pool, RecursiveAction a) { in testInvokeOnPool() argument
104 try (PoolCleaner cleaner = cleaner(pool)) { in testInvokeOnPool()
112 assertNull(pool.invoke(a)); in testInvokeOnPool()
411 public void testInvoke(ForkJoinPool pool) {
418 testInvokeOnPool(pool, a);
432 public void testQuietlyInvoke(ForkJoinPool pool) {
439 testInvokeOnPool(pool, a);
451 public void testForkJoin(ForkJoinPool pool) {
459 testInvokeOnPool(pool, a);
471 public void testForkGet(ForkJoinPool pool) {
[all …]
DJSR166TestCase.java986 private final ExecutorService pool; field in JSR166TestCase.PoolCleaner
987 public PoolCleaner(ExecutorService pool) { this.pool = pool; } in PoolCleaner() argument
988 public void close() { joinPool(pool); } in close()
996 public PoolCleanerWithReleaser(ExecutorService pool, Runnable releaser) { in PoolCleanerWithReleaser() argument
997 super(pool); in PoolCleanerWithReleaser()
1009 PoolCleaner cleaner(ExecutorService pool) { in cleaner() argument
1010 return new PoolCleaner(pool); in cleaner()
1013 PoolCleaner cleaner(ExecutorService pool, Runnable releaser) { in cleaner() argument
1014 return new PoolCleanerWithReleaser(pool, releaser); in cleaner()
1017 PoolCleaner cleaner(ExecutorService pool, CountDownLatch latch) { in cleaner() argument
[all …]
DDoubleAccumulatorTest.java150 final ExecutorService pool = Executors.newCachedThreadPool(); in testAccumulateAndGetMT() local
154 pool.execute(new AccTask(a, phaser, incs)); in testAccumulateAndGetMT()
160 pool.shutdown(); in testAccumulateAndGetMT()
DDoubleAdderTest.java162 final ExecutorService pool = Executors.newCachedThreadPool(); in testAddAndSumMT() local
166 pool.execute(new AdderTask(a, barrier, incs)); in testAddAndSumMT()
172 pool.shutdown(); in testAddAndSumMT()
DLongAccumulatorTest.java150 final ExecutorService pool = Executors.newCachedThreadPool(); in testAccumulateAndGetMT() local
154 pool.execute(new AccTask(a, phaser, incs)); in testAccumulateAndGetMT()
160 pool.shutdown(); in testAccumulateAndGetMT()
DLongAdderTest.java185 final ExecutorService pool = Executors.newCachedThreadPool(); in testAddAndSumMT() local
189 pool.execute(new AdderTask(a, barrier, incs)); in testAddAndSumMT()
195 pool.shutdown(); in testAddAndSumMT()
/libcore/luni/src/main/java/libcore/internal/
DStringPool.java28 private final String[] pool = new String[512]; field in StringPool
58 int index = hashCode & (pool.length - 1); in get()
60 String pooled = pool[index]; in get()
66 pool[index] = result; in get()
/libcore/ojluni/src/test/java/util/Properties/
DConcurrentLoadAndStoreXML.java93 ExecutorService pool = Executors.newFixedThreadPool(NTASKS); in main() local
98 task[i] = pool.submit(basher[i]); in main()
111 pool.shutdown(); in main()

12