src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java

Print this page

        

*** 190,200 **** */ private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 24; // 16M /** * The work-stealing queue array. Size must be a power of two. ! * Initialized when started (as oposed to when constructed), to * improve memory locality. */ ForkJoinTask<?>[] queue; /** --- 190,200 ---- */ private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 24; // 16M /** * The work-stealing queue array. Size must be a power of two. ! * Initialized when started (as opposed to when constructed), to * improve memory locality. */ ForkJoinTask<?>[] queue; /**
*** 358,368 **** * threads work correctly even before this thread starts * processing tasks. */ protected void onStart() { queue = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY]; ! int r = pool.workerSeedGenerator.nextInt(); seed = (r == 0) ? 1 : r; // must be nonzero } /** * Performs cleanup associated with termination of this worker --- 358,368 ---- * threads work correctly even before this thread starts * processing tasks. */ protected void onStart() { queue = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY]; ! int r = ForkJoinPool.workerSeedGenerator.nextInt(); seed = (r == 0) ? 1 : r; // must be nonzero } /** * Performs cleanup associated with termination of this worker
*** 982,992 **** static { int s; try { UNSAFE = sun.misc.Unsafe.getUnsafe(); ! Class a = ForkJoinTask[].class; ABASE = UNSAFE.arrayBaseOffset(a); s = UNSAFE.arrayIndexScale(a); } catch (Exception e) { throw new Error(e); } --- 982,992 ---- static { int s; try { UNSAFE = sun.misc.Unsafe.getUnsafe(); ! Class<?> a = ForkJoinTask[].class; ABASE = UNSAFE.arrayBaseOffset(a); s = UNSAFE.arrayIndexScale(a); } catch (Exception e) { throw new Error(e); }