mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
* NPE bugfix for parallel() function
This commit is contained in:
parent
d01d858713
commit
ad79f0c13d
@ -52,7 +52,7 @@ import java.util.concurrent.*
|
|||||||
|
|
||||||
def parallel(List closures, int threads = Runtime.getRuntime().availableProcessors()) {
|
def parallel(List closures, int threads = Runtime.getRuntime().availableProcessors()) {
|
||||||
def tasks = closures.collect { it as Callable }
|
def tasks = closures.collect { it as Callable }
|
||||||
return Executors.newFixedThreadPool(threads).invokeAll(tasks).collect{ _guarded { it.get() } }
|
return Executors.newFixedThreadPool(threads).invokeAll(tasks).collect{ c -> _guarded { c.get() } }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user