3490 commonMaxSpares = Integer.parseInt(p);
3491 } catch (Exception ignore) {}
3492 COMMON_MAX_SPARES = commonMaxSpares;
3493
3494 defaultForkJoinWorkerThreadFactory =
3495 new DefaultForkJoinWorkerThreadFactory();
3496 modifyThreadPermission = new RuntimePermission("modifyThread");
3497
3498 common = java.security.AccessController.doPrivileged
3499 (new java.security.PrivilegedAction<ForkJoinPool>() {
3500 public ForkJoinPool run() { return makeCommonPool(); }});
3501
3502 // report 1 even if threads disabled
3503 COMMON_PARALLELISM = Math.max(common.config & SMASK, 1);
3504 }
3505
3506 /**
3507 * Creates and returns the common pool, respecting user settings
3508 * specified via system properties.
3509 */
3510 static ForkJoinPool makeCommonPool() {
3511 int parallelism = -1;
3512 ForkJoinWorkerThreadFactory factory = null;
3513 UncaughtExceptionHandler handler = null;
3514 try { // ignore exceptions in accessing/parsing properties
3515 String pp = System.getProperty
3516 ("java.util.concurrent.ForkJoinPool.common.parallelism");
3517 String fp = System.getProperty
3518 ("java.util.concurrent.ForkJoinPool.common.threadFactory");
3519 String hp = System.getProperty
3520 ("java.util.concurrent.ForkJoinPool.common.exceptionHandler");
3521 if (pp != null)
3522 parallelism = Integer.parseInt(pp);
3523 if (fp != null)
3524 factory = ((ForkJoinWorkerThreadFactory)ClassLoader.
3525 getSystemClassLoader().loadClass(fp).newInstance());
3526 if (hp != null)
3527 handler = ((UncaughtExceptionHandler)ClassLoader.
3528 getSystemClassLoader().loadClass(hp).newInstance());
3529 } catch (Exception ignore) {
|
3490 commonMaxSpares = Integer.parseInt(p);
3491 } catch (Exception ignore) {}
3492 COMMON_MAX_SPARES = commonMaxSpares;
3493
3494 defaultForkJoinWorkerThreadFactory =
3495 new DefaultForkJoinWorkerThreadFactory();
3496 modifyThreadPermission = new RuntimePermission("modifyThread");
3497
3498 common = java.security.AccessController.doPrivileged
3499 (new java.security.PrivilegedAction<ForkJoinPool>() {
3500 public ForkJoinPool run() { return makeCommonPool(); }});
3501
3502 // report 1 even if threads disabled
3503 COMMON_PARALLELISM = Math.max(common.config & SMASK, 1);
3504 }
3505
3506 /**
3507 * Creates and returns the common pool, respecting user settings
3508 * specified via system properties.
3509 */
3510 @SuppressWarnings("deprecation") // Class.newInstance
3511 static ForkJoinPool makeCommonPool() {
3512 int parallelism = -1;
3513 ForkJoinWorkerThreadFactory factory = null;
3514 UncaughtExceptionHandler handler = null;
3515 try { // ignore exceptions in accessing/parsing properties
3516 String pp = System.getProperty
3517 ("java.util.concurrent.ForkJoinPool.common.parallelism");
3518 String fp = System.getProperty
3519 ("java.util.concurrent.ForkJoinPool.common.threadFactory");
3520 String hp = System.getProperty
3521 ("java.util.concurrent.ForkJoinPool.common.exceptionHandler");
3522 if (pp != null)
3523 parallelism = Integer.parseInt(pp);
3524 if (fp != null)
3525 factory = ((ForkJoinWorkerThreadFactory)ClassLoader.
3526 getSystemClassLoader().loadClass(fp).newInstance());
3527 if (hp != null)
3528 handler = ((UncaughtExceptionHandler)ClassLoader.
3529 getSystemClassLoader().loadClass(hp).newInstance());
3530 } catch (Exception ignore) {
|