426 String msg = propName + " is set to a value that is not a power of 2";
427 throw new IllegalArgumentException(msg);
428 }
429 return count;
430 }
431
432 /**
433 * Starts a platform thread to run the given task.
434 */
435 private void startPlatformThread(String name, Runnable task) {
436 try {
437 Thread thread = InnocuousThread.newSystemThread(name, task);
438 thread.setDaemon(true);
439 thread.setUncaughtExceptionHandler((t, e) -> e.printStackTrace());
440 thread.start();
441 } catch (Exception e) {
442 throw new InternalError(e);
443 }
444 }
445 }
446 }
|
426 String msg = propName + " is set to a value that is not a power of 2";
427 throw new IllegalArgumentException(msg);
428 }
429 return count;
430 }
431
432 /**
433 * Starts a platform thread to run the given task.
434 */
435 private void startPlatformThread(String name, Runnable task) {
436 try {
437 Thread thread = InnocuousThread.newSystemThread(name, task);
438 thread.setDaemon(true);
439 thread.setUncaughtExceptionHandler((t, e) -> e.printStackTrace());
440 thread.start();
441 } catch (Exception e) {
442 throw new InternalError(e);
443 }
444 }
445 }
446
447 /**
448 * Return the master poller or null if there is no master poller.
449 */
450 public static Poller masterPoller() {
451 return POLLERS.masterPoller();
452 }
453
454 /**
455 * Return the list of read pollers.
456 */
457 public static List<Poller> readPollers() {
458 return POLLERS.readPollers();
459 }
460
461 /**
462 * Return the list of write pollers.
463 */
464 public static List<Poller> writePollers() {
465 return POLLERS.writePollers();
466 }
467 }
|