ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ForkJoinWorkerThread.java
(Generate patch)

Comparing jsr166/src/jsr166e/ForkJoinWorkerThread.java (file contents):
Revision 1.1 by dl, Mon Aug 13 15:52:33 2012 UTC vs.
Revision 1.4 by dl, Wed Nov 21 19:54:32 2012 UTC

# Line 25 | Line 25 | public class ForkJoinWorkerThread extend
25       * ForkJoinWorkerThreads are managed by ForkJoinPools and perform
26       * ForkJoinTasks. For explanation, see the internal documentation
27       * of class ForkJoinPool.
28 +     *
29 +     * This class just maintains links to its pool and WorkQueue.  The
30 +     * pool field is set immediately upon construction, but the
31 +     * workQueue field is not set until a call to registerWorker
32 +     * completes. This leads to a visibility race, that is tolerated
33 +     * by requiring that the workQueue field is only accessed by the
34 +     * owning thread.
35       */
36  
30    final ForkJoinPool.WorkQueue workQueue; // Work-stealing mechanics
37      final ForkJoinPool pool;                // the pool this thread works in
38 +    final ForkJoinPool.WorkQueue workQueue; // work-stealing mechanics
39  
40      /**
41       * Creates a ForkJoinWorkerThread operating in the given pool.
# Line 37 | Line 44 | public class ForkJoinWorkerThread extend
44       * @throws NullPointerException if pool is null
45       */
46      protected ForkJoinWorkerThread(ForkJoinPool pool) {
47 <        super(pool.nextWorkerName());
48 <        setDaemon(true);
42 <        Thread.UncaughtExceptionHandler ueh = pool.ueh;
43 <        if (ueh != null)
44 <            setUncaughtExceptionHandler(ueh);
47 >        // Use a placeholder until a useful name can be set in registerWorker
48 >        super("aForkJoinWorkerThread");
49          this.pool = pool;
50 <        pool.registerWorker(this.workQueue = new ForkJoinPool.WorkQueue
47 <                            (pool, this, pool.localMode));
50 >        this.workQueue = pool.registerWorker(this);
51      }
52  
53      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines