Projects
Mega:24.03
gpars
_service:tar_scm:0001-JSR-166.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0001-JSR-166.patch of Package gpars
From f8f1810ce3828b5507dbfe68f348f35644f52314 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski <mizdebsk@redhat.com> Date: Tue, 4 Nov 2014 12:05:10 +0100 Subject: [PATCH 1/3] JSR-166 --- src/main/groovy/groovyx/gpars/GParsPool.groovy | 14 +++++++------- src/main/groovy/groovyx/gpars/GParsPoolUtil.java | 8 ++++---- .../groovyx/gpars/forkjoin/AbstractForkJoinWorker.java | 2 +- src/main/groovy/groovyx/gpars/forkjoin/ForkJoinUtils.java | 4 ++-- src/main/groovy/groovyx/gpars/group/PGroupBuilder.java | 2 +- src/main/groovy/groovyx/gpars/pa/CallAsyncTask.java | 2 +- src/main/groovy/groovyx/gpars/pa/ClosureMapper.java | 2 +- .../groovy/groovyx/gpars/pa/ClosureNegationPredicate.java | 2 +- src/main/groovy/groovyx/gpars/pa/ClosurePredicate.java | 2 +- src/main/groovy/groovyx/gpars/pa/ClosureReducer.java | 2 +- .../groovy/groovyx/gpars/pa/GParsPoolUtilHelper.groovy | 8 ++++---- src/main/groovy/groovyx/gpars/pa/MappedPAWrapper.groovy | 2 +- src/main/groovy/groovyx/gpars/scheduler/FJPool.java | 2 +- src/test/groovy/groovyx/gpars/ForkJoinPoolDSLTest.groovy | 2 +- src/test/groovy/groovyx/gpars/GParsPoolAsyncFunTest.groovy | 2 +- src/test/groovy/groovyx/gpars/GParsPoolUtilTest.groovy | 2 +- .../groovyx/gpars/benchmark/BenchmarkGParsPool.groovy | 2 +- src/test/groovy/groovyx/gpars/groups/FJGroupTest.groovy | 2 +- .../groovy/groovyx/gpars/groups/PGroupBuilderTest.groovy | 2 +- .../groovyx/gpars/samples/forkjoin/DemoFJDirect.groovy | 6 +++--- .../samples/forkjoin/DemoRawForkJoinFileCounter.groovy | 2 +- .../groovyx/gpars/samples/group/DemoPoolToGroup.groovy | 2 +- 22 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main/groovy/groovyx/gpars/GParsPool.groovy b/src/main/groovy/groovyx/gpars/GParsPool.groovy index 4b6bfdd..f34e97c 100644 --- a/src/main/groovy/groovyx/gpars/GParsPool.groovy +++ b/src/main/groovy/groovyx/gpars/GParsPool.groovy @@ -20,8 +20,8 @@ import groovyx.gpars.dataflow.DataflowVariable import groovyx.gpars.forkjoin.AbstractForkJoinWorker import groovyx.gpars.forkjoin.ForkJoinUtils import groovyx.gpars.util.PoolUtils -import jsr166y.ForkJoinPool -import jsr166y.RecursiveTask +import java.util.concurrent.ForkJoinPool +import java.util.concurrent.RecursiveTask import java.lang.Thread.UncaughtExceptionHandler import java.util.concurrent.Future @@ -76,7 +76,7 @@ public class GParsPool { private static createPool(int poolSize, UncaughtExceptionHandler handler) { if (!(poolSize in 1..Integer.MAX_VALUE)) throw new IllegalArgumentException("Invalid value $poolSize for the pool size has been specified. Please supply a positive int number.") - final jsr166y.ForkJoinPool pool = new jsr166y.ForkJoinPool(poolSize, ForkJoinPool.defaultForkJoinWorkerThreadFactory, handler, false) + final java.util.concurrent.ForkJoinPool pool = new java.util.concurrent.ForkJoinPool(poolSize, ForkJoinPool.defaultForkJoinWorkerThreadFactory, handler, false) return pool } @@ -140,7 +140,7 @@ public class GParsPool { * @param cl The block of code to invoke with the DSL enabled */ public static withPool(int numberOfThreads, UncaughtExceptionHandler handler, Closure cl) { - final jsr166y.ForkJoinPool pool = createPool(numberOfThreads, handler) + final java.util.concurrent.ForkJoinPool pool = createPool(numberOfThreads, handler) try { return withExistingPool(pool, cl) } finally { @@ -165,7 +165,7 @@ public class GParsPool { *}* </pre> * @param pool The thread pool to use, the pool will not be shutdown after this method returns */ - public static withExistingPool(jsr166y.ForkJoinPool pool, Closure cl) { + public static withExistingPool(java.util.concurrent.ForkJoinPool pool, Closure cl) { currentPoolStack << pool def result = null @@ -184,7 +184,7 @@ public class GParsPool { * Just like withExistingPool() registers a thread pool, but doesn't install the GParsPoolUtil category. * Used by ParallelEnhancer's Parallel mixins. */ - static ensurePool(final jsr166y.ForkJoinPool pool, final Closure cl) { + static ensurePool(final java.util.concurrent.ForkJoinPool pool, final Closure cl) { currentPoolStack << pool try { return cl(pool) @@ -226,7 +226,7 @@ public class GParsPool { * @return Futures for the result values or exceptions of all closures */ public static List<Future<Object>> executeAsync(Closure... closures) { - jsr166y.ForkJoinPool pool = retrieveCurrentPool() + java.util.concurrent.ForkJoinPool pool = retrieveCurrentPool() if (pool == null) throw new IllegalStateException("No active Fork/Join thread pool available to execute closures asynchronously. Consider wrapping the function call with GParsPool.withPool().") List<Future<Object>> result = closures.collect { cl -> pool.submit(new MyCancellableRecursiveTask(cl)) diff --git a/src/main/groovy/groovyx/gpars/GParsPoolUtil.java b/src/main/groovy/groovyx/gpars/GParsPoolUtil.java index ff6aed1..8e85943 100644 --- a/src/main/groovy/groovyx/gpars/GParsPoolUtil.java +++ b/src/main/groovy/groovyx/gpars/GParsPoolUtil.java @@ -18,8 +18,8 @@ package groovyx.gpars; import groovy.lang.Closure; import groovy.time.Duration; -import groovyx.gpars.extra166y.Ops; -import groovyx.gpars.extra166y.ParallelArray; +import extra166y.Ops; +import extra166y.ParallelArray; import groovyx.gpars.memoize.LRUProtectionStorage; import groovyx.gpars.pa.CallAsyncTask; import groovyx.gpars.pa.CallClosure; @@ -33,8 +33,8 @@ import groovyx.gpars.pa.SumClosure; import groovyx.gpars.scheduler.FJPool; import groovyx.gpars.util.GeneralTimer; import groovyx.gpars.util.PAUtils; -import jsr166y.ForkJoinPool; -import jsr166y.RecursiveTask; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.RecursiveTask; import java.util.ArrayList; import java.util.Collection; diff --git a/src/main/groovy/groovyx/gpars/forkjoin/AbstractForkJoinWorker.java b/src/main/groovy/groovyx/gpars/forkjoin/AbstractForkJoinWorker.java index e8dbc51..033ecec 100644 --- a/src/main/groovy/groovyx/gpars/forkjoin/AbstractForkJoinWorker.java +++ b/src/main/groovy/groovyx/gpars/forkjoin/AbstractForkJoinWorker.java @@ -16,7 +16,7 @@ package groovyx.gpars.forkjoin; -import jsr166y.RecursiveTask; +import java.util.concurrent.RecursiveTask; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/groovy/groovyx/gpars/forkjoin/ForkJoinUtils.java b/src/main/groovy/groovyx/gpars/forkjoin/ForkJoinUtils.java index 97b5149..8f4c758 100644 --- a/src/main/groovy/groovyx/gpars/forkjoin/ForkJoinUtils.java +++ b/src/main/groovy/groovyx/gpars/forkjoin/ForkJoinUtils.java @@ -16,8 +16,8 @@ package groovyx.gpars.forkjoin; -import jsr166y.ForkJoinPool; -import jsr166y.ForkJoinTask; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.ForkJoinTask; import java.util.concurrent.ExecutionException; diff --git a/src/main/groovy/groovyx/gpars/group/PGroupBuilder.java b/src/main/groovy/groovyx/gpars/group/PGroupBuilder.java index 0a2d893..b0c787a 100644 --- a/src/main/groovy/groovyx/gpars/group/PGroupBuilder.java +++ b/src/main/groovy/groovyx/gpars/group/PGroupBuilder.java @@ -19,7 +19,7 @@ package groovyx.gpars.group; import groovyx.gpars.scheduler.DefaultPool; import groovyx.gpars.scheduler.FJPool; import groovyx.gpars.scheduler.Pool; -import jsr166y.ForkJoinPool; +import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ThreadPoolExecutor; diff --git a/src/main/groovy/groovyx/gpars/pa/CallAsyncTask.java b/src/main/groovy/groovyx/gpars/pa/CallAsyncTask.java index e7d1d5c..6610217 100644 --- a/src/main/groovy/groovyx/gpars/pa/CallAsyncTask.java +++ b/src/main/groovy/groovyx/gpars/pa/CallAsyncTask.java @@ -17,7 +17,7 @@ package groovyx.gpars.pa; import groovy.lang.Closure; -import jsr166y.RecursiveTask; +import java.util.concurrent.RecursiveTask; /** * A helper class to wrap closures for callAsync on GParsPool diff --git a/src/main/groovy/groovyx/gpars/pa/ClosureMapper.java b/src/main/groovy/groovyx/gpars/pa/ClosureMapper.java index df090da..2e20bc8 100644 --- a/src/main/groovy/groovyx/gpars/pa/ClosureMapper.java +++ b/src/main/groovy/groovyx/gpars/pa/ClosureMapper.java @@ -16,7 +16,7 @@ package groovyx.gpars.pa; -import groovyx.gpars.extra166y.Ops; +import extra166y.Ops; import groovy.lang.Closure; /** diff --git a/src/main/groovy/groovyx/gpars/pa/ClosureNegationPredicate.java b/src/main/groovy/groovyx/gpars/pa/ClosureNegationPredicate.java index dc2e782..22987ec 100644 --- a/src/main/groovy/groovyx/gpars/pa/ClosureNegationPredicate.java +++ b/src/main/groovy/groovyx/gpars/pa/ClosureNegationPredicate.java @@ -16,7 +16,7 @@ package groovyx.gpars.pa; -import groovyx.gpars.extra166y.Ops; +import extra166y.Ops; import groovy.lang.Closure; /** diff --git a/src/main/groovy/groovyx/gpars/pa/ClosurePredicate.java b/src/main/groovy/groovyx/gpars/pa/ClosurePredicate.java index d2fae30..620bd01 100644 --- a/src/main/groovy/groovyx/gpars/pa/ClosurePredicate.java +++ b/src/main/groovy/groovyx/gpars/pa/ClosurePredicate.java @@ -16,7 +16,7 @@ package groovyx.gpars.pa; -import groovyx.gpars.extra166y.Ops; +import extra166y.Ops; import groovy.lang.Closure; /** diff --git a/src/main/groovy/groovyx/gpars/pa/ClosureReducer.java b/src/main/groovy/groovyx/gpars/pa/ClosureReducer.java index c0a35f2..4ff7adc 100644 --- a/src/main/groovy/groovyx/gpars/pa/ClosureReducer.java +++ b/src/main/groovy/groovyx/gpars/pa/ClosureReducer.java @@ -16,7 +16,7 @@ package groovyx.gpars.pa; -import groovyx.gpars.extra166y.Ops; +import extra166y.Ops; import groovy.lang.Closure; /** diff --git a/src/main/groovy/groovyx/gpars/pa/GParsPoolUtilHelper.groovy b/src/main/groovy/groovyx/gpars/pa/GParsPoolUtilHelper.groovy index a23dfe6..b6f6fdc 100644 --- a/src/main/groovy/groovyx/gpars/pa/GParsPoolUtilHelper.groovy +++ b/src/main/groovy/groovyx/gpars/pa/GParsPoolUtilHelper.groovy @@ -20,15 +20,15 @@ import groovyx.gpars.GParsPool import groovyx.gpars.GParsPoolUtil import groovyx.gpars.TransparentParallel import groovyx.gpars.dataflow.DataflowVariable -import groovyx.gpars.extra166y.Ops -import groovyx.gpars.extra166y.ParallelArray -import groovyx.gpars.extra166y.ParallelArrayWithMapping +import extra166y.Ops +import extra166y.ParallelArray +import extra166y.ParallelArrayWithMapping import groovyx.gpars.memoize.LRUProtectionStorage import groovyx.gpars.memoize.NullProtectionStorage import groovyx.gpars.memoize.NullValue import groovyx.gpars.scheduler.FJPool import groovyx.gpars.util.PAUtils -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool import java.lang.ref.ReferenceQueue import java.lang.ref.SoftReference diff --git a/src/main/groovy/groovyx/gpars/pa/MappedPAWrapper.groovy b/src/main/groovy/groovyx/gpars/pa/MappedPAWrapper.groovy index 07c235e..b48938f 100644 --- a/src/main/groovy/groovyx/gpars/pa/MappedPAWrapper.groovy +++ b/src/main/groovy/groovyx/gpars/pa/MappedPAWrapper.groovy @@ -16,7 +16,7 @@ package groovyx.gpars.pa -import groovyx.gpars.extra166y.ParallelArrayWithMapping +import extra166y.ParallelArrayWithMapping /** * The ParallelArray wrapper used after the map() operation diff --git a/src/main/groovy/groovyx/gpars/scheduler/FJPool.java b/src/main/groovy/groovyx/gpars/scheduler/FJPool.java index 359e344..148be60 100644 --- a/src/main/groovy/groovyx/gpars/scheduler/FJPool.java +++ b/src/main/groovy/groovyx/gpars/scheduler/FJPool.java @@ -17,7 +17,7 @@ package groovyx.gpars.scheduler; import groovyx.gpars.util.PoolUtils; -import jsr166y.ForkJoinPool; +import java.util.concurrent.ForkJoinPool; import java.util.concurrent.TimeUnit; diff --git a/src/test/groovy/groovyx/gpars/ForkJoinPoolDSLTest.groovy b/src/test/groovy/groovyx/gpars/ForkJoinPoolDSLTest.groovy index 5c2b6a8..9195b9d 100644 --- a/src/test/groovy/groovyx/gpars/ForkJoinPoolDSLTest.groovy +++ b/src/test/groovy/groovyx/gpars/ForkJoinPoolDSLTest.groovy @@ -17,7 +17,7 @@ package groovyx.gpars import java.lang.Thread.UncaughtExceptionHandler -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool import static groovyx.gpars.GParsPool.withExistingPool import static groovyx.gpars.GParsPool.withPool diff --git a/src/test/groovy/groovyx/gpars/GParsPoolAsyncFunTest.groovy b/src/test/groovy/groovyx/gpars/GParsPoolAsyncFunTest.groovy index a27b200..203f2bb 100644 --- a/src/test/groovy/groovyx/gpars/GParsPoolAsyncFunTest.groovy +++ b/src/test/groovy/groovyx/gpars/GParsPoolAsyncFunTest.groovy @@ -19,7 +19,7 @@ package groovyx.gpars import groovyx.gpars.dataflow.DataflowQueue import groovyx.gpars.dataflow.Promise import groovyx.gpars.scheduler.FJPool -import jsr166y.RecursiveAction +import java.util.concurrent.RecursiveAction /** * @author Vaclav Pech diff --git a/src/test/groovy/groovyx/gpars/GParsPoolUtilTest.groovy b/src/test/groovy/groovyx/gpars/GParsPoolUtilTest.groovy index a7c60fd..5c0d642 100644 --- a/src/test/groovy/groovyx/gpars/GParsPoolUtilTest.groovy +++ b/src/test/groovy/groovyx/gpars/GParsPoolUtilTest.groovy @@ -16,7 +16,7 @@ package groovyx.gpars -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool import java.lang.Thread.UncaughtExceptionHandler import java.util.concurrent.ConcurrentHashMap diff --git a/src/test/groovy/groovyx/gpars/benchmark/BenchmarkGParsPool.groovy b/src/test/groovy/groovyx/gpars/benchmark/BenchmarkGParsPool.groovy index 7932ab0..6a7e476 100644 --- a/src/test/groovy/groovyx/gpars/benchmark/BenchmarkGParsPool.groovy +++ b/src/test/groovy/groovyx/gpars/benchmark/BenchmarkGParsPool.groovy @@ -21,7 +21,7 @@ import groovyx.gpars.GParsPoolUtil import groovyx.gpars.ParallelEnhancer import groovyx.gpars.extra166y.Ops.Reducer import groovyx.gpars.extra166y.ParallelArray -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool import static groovyx.gpars.GParsPool.withExistingPool import static groovyx.gpars.GParsPool.withPool diff --git a/src/test/groovy/groovyx/gpars/groups/FJGroupTest.groovy b/src/test/groovy/groovyx/gpars/groups/FJGroupTest.groovy index d879203..554c59f 100644 --- a/src/test/groovy/groovyx/gpars/groups/FJGroupTest.groovy +++ b/src/test/groovy/groovyx/gpars/groups/FJGroupTest.groovy @@ -21,7 +21,7 @@ import groovyx.gpars.group.DefaultPGroup import groovyx.gpars.scheduler.DefaultPool import groovyx.gpars.scheduler.FJPool import java.util.concurrent.CountDownLatch -import jsr166y.ForkJoinWorkerThread +import java.util.concurrent.ForkJoinWorkerThread public class FJGroupTest extends GroovyTestCase { public void testFJGroup() { diff --git a/src/test/groovy/groovyx/gpars/groups/PGroupBuilderTest.groovy b/src/test/groovy/groovyx/gpars/groups/PGroupBuilderTest.groovy index b849e44..120088e 100644 --- a/src/test/groovy/groovyx/gpars/groups/PGroupBuilderTest.groovy +++ b/src/test/groovy/groovyx/gpars/groups/PGroupBuilderTest.groovy @@ -22,7 +22,7 @@ import groovyx.gpars.scheduler.DefaultPool import groovyx.gpars.scheduler.Pool import java.util.concurrent.ExecutorService import java.util.concurrent.Executors -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool class PGroupBuilderTest extends GroovyTestCase { public void testCreationFromPool() { diff --git a/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoFJDirect.groovy b/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoFJDirect.groovy index ee8d2ac..e7f249a 100644 --- a/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoFJDirect.groovy +++ b/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoFJDirect.groovy @@ -16,9 +16,9 @@ package groovyx.gpars.samples.forkjoin -import jsr166y.ForkJoinPool -import jsr166y.ForkJoinTask -import jsr166y.RecursiveTask +import java.util.concurrent.ForkJoinPool +import java.util.concurrent.ForkJoinTask +import java.util.concurrent.RecursiveTask class Fibonacci extends RecursiveTask<Integer> { final int n; diff --git a/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoRawForkJoinFileCounter.groovy b/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoRawForkJoinFileCounter.groovy index 5356cbc..af509dd 100644 --- a/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoRawForkJoinFileCounter.groovy +++ b/src/test/groovy/groovyx/gpars/samples/forkjoin/DemoRawForkJoinFileCounter.groovy @@ -17,7 +17,7 @@ package groovyx.gpars.samples.forkjoin import groovyx.gpars.GParsPool -import jsr166y.RecursiveTask +import java.util.concurrent.RecursiveTask /** * Shows use of the ForkJoin mechanics to count files recursively in a directory. diff --git a/src/test/groovy/groovyx/gpars/samples/group/DemoPoolToGroup.groovy b/src/test/groovy/groovyx/gpars/samples/group/DemoPoolToGroup.groovy index 9f88b9c..7fe29ed 100644 --- a/src/test/groovy/groovyx/gpars/samples/group/DemoPoolToGroup.groovy +++ b/src/test/groovy/groovyx/gpars/samples/group/DemoPoolToGroup.groovy @@ -21,7 +21,7 @@ import groovyx.gpars.GParsPool import groovyx.gpars.group.PGroup import groovyx.gpars.group.PGroupBuilder import java.util.concurrent.ExecutorService -import jsr166y.ForkJoinPool +import java.util.concurrent.ForkJoinPool /** * Demonstrates how to use existing thread pool to build an instance of PGroup and then retrieve the pool back from the group. -- 2.13.6
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2