comparison org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Worker.d @ 19:52184e4b815c

no more direct tango.core.Thread. Rename JThread to java.lang.Thread.
author Frank Benoit <benoit@tionex.de>
date Wed, 18 Mar 2009 10:55:25 +0100
parents 6f068362a363
children 8594250b1d1c
comparison
equal deleted inserted replaced
18:735224fcc45f 19:52184e4b815c
10 * Port to the D programming language: 10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module org.eclipse.core.internal.jobs.Worker; 13 module org.eclipse.core.internal.jobs.Worker;
14 14
15 import java.lang.JThread; 15 import java.lang.Thread;
16 import java.lang.all; 16 import java.lang.all;
17 import java.util.Set; 17 import java.util.Set;
18 18
19 import org.eclipse.core.internal.runtime.RuntimeLog; 19 import org.eclipse.core.internal.runtime.RuntimeLog;
20 import org.eclipse.core.runtime.IStatus; 20 import org.eclipse.core.runtime.IStatus;
30 30
31 /** 31 /**
32 * A worker thread processes jobs supplied to it by the worker pool. When 32 * A worker thread processes jobs supplied to it by the worker pool. When
33 * the worker pool gives it a null job, the worker dies. 33 * the worker pool gives it a null job, the worker dies.
34 */ 34 */
35 public class Worker : JThread { 35 public class Worker : Thread {
36 //worker number used for debugging purposes only 36 //worker number used for debugging purposes only
37 private static int nextWorkerNumber = 0; 37 private static int nextWorkerNumber = 0;
38 private /+volatile+/ InternalJob currentJob_; 38 private /+volatile+/ InternalJob currentJob_;
39 private final WorkerPool pool; 39 private final WorkerPool pool;
40 40
78 // throw e; 78 // throw e;
79 // } catch (Error e) { 79 // } catch (Error e) {
80 // result = handleException(currentJob_, e); 80 // result = handleException(currentJob_, e);
81 } finally { 81 } finally {
82 //clear interrupted state for this thread 82 //clear interrupted state for this thread
83 JThread.interrupted(); 83 Thread.interrupted();
84 84
85 //result must not be null 85 //result must not be null
86 if (result is null) 86 if (result is null)
87 result = handleException(currentJob_, new NullPointerException()); 87 result = handleException(currentJob_, new NullPointerException());
88 pool.endJob_package(currentJob_, result); 88 pool.endJob_package(currentJob_, result);