use of java8.util.concurrent.ForkJoinPool in project streamsupport by stefan-zobel.
the class RecursiveTaskTest method testGetPool.
/**
* getPool of executing task returns its pool
*/
public void testGetPool() {
final ForkJoinPool mainPool = mainPool();
@SuppressWarnings("serial") RecursiveTask<Integer> a = new CheckedRecursiveTask<Integer>() {
public Integer realCompute() {
assertSame(mainPool, getPool());
return NoResult;
}
};
assertSame(NoResult, testInvokeOnPool(mainPool, a));
}
use of java8.util.concurrent.ForkJoinPool in project streamsupport by stefan-zobel.
the class CountedCompleterTest method testGetPool.
/**
* getPool of executing task returns its pool
*/
public void testGetPool() {
final ForkJoinPool mainPool = mainPool();
@SuppressWarnings("serial") ForkJoinTask<?> a = new CheckedRecursiveAction() {
protected void realCompute() {
assertSame(mainPool, getPool());
}
};
testInvokeOnPool(mainPool, a);
}
use of java8.util.concurrent.ForkJoinPool in project streamsupport by stefan-zobel.
the class ForkJoinTaskTest method testGetPool.
/**
* getPool of executing task returns its pool
*/
public void testGetPool() {
final ForkJoinPool mainPool = mainPool();
@SuppressWarnings("serial") RecursiveAction a = new CheckedRecursiveAction() {
protected void realCompute() {
assertSame(mainPool, getPool());
}
};
testInvokeOnPool(mainPool, a);
}
Aggregations