Mercurial > projects > dwt2
changeset 19:52184e4b815c
no more direct tango.core.Thread. Rename JThread to java.lang.Thread.
line wrap: on
line diff
--- a/java/src/java/lang/JThread.d Wed Mar 18 09:57:53 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -module java.lang.JThread; - -import tango.core.Thread; -import java.lang.util; -import java.lang.Runnable; -import tango.util.log.Trace; - -class JThread { - - private Thread thread; - private Runnable runnable; - - private alias ThreadLocal!(JThread) TTLS; - private static TTLS tls; - - public static const int MAX_PRIORITY = 10; - public static const int MIN_PRIORITY = 1; - public static const int NORM_PRIORITY = 5; - - private static TTLS getTls(){ - if( tls is null ){ - synchronized( JThread.classinfo ){ - if( tls is null ){ - tls = new TTLS(); - } - } - } - return tls; - } - - public this(){ - thread = new Thread(&internalRun); - } - public this( void delegate() dg ){ - thread = new Thread(&internalRun); - runnable = dgRunnable( dg ); - } - public this(Runnable runnable){ - thread = new Thread(&internalRun); - this.runnable = runnable; - } - public this(Runnable runnable, String name){ - thread = new Thread(&internalRun); - this.runnable = runnable; - thread.name = name; - } - public this(String name){ - thread = new Thread(&internalRun); - thread.name = name; - } - - public void start(){ - thread.start(); - } - - public static JThread currentThread(){ - auto res = getTls().val(); - if( res is null ){ - // no synchronized needed - res = new JThread(); - res.thread = Thread.getThis(); - getTls().val( res ); - } - assert( res ); - return res; - } - public int getPriority() { - return (thread.priority-Thread.PRIORITY_MIN) * (MAX_PRIORITY-MIN_PRIORITY) / (Thread.PRIORITY_MAX-Thread.PRIORITY_MIN) + MIN_PRIORITY; - } - public void setPriority( int newPriority ) { -// assert( MIN_PRIORITY < MAX_PRIORITY ); -// assert( Thread.PRIORITY_MIN < Thread.PRIORITY_MAX ); - auto scaledPrio = (newPriority-MIN_PRIORITY) * (Thread.PRIORITY_MAX-Thread.PRIORITY_MIN) / (MAX_PRIORITY-MIN_PRIORITY) +Thread.PRIORITY_MIN; - Trace.formatln( "JThread.setPriority: scale ({} {} {}) -> ({} {} {})", MIN_PRIORITY, newPriority, MAX_PRIORITY, Thread.PRIORITY_MIN, scaledPrio, Thread.PRIORITY_MAX); -// thread.priority( scaledPrio ); - } - - private void internalRun(){ - getTls().val( this ); - if( runnable !is null ){ - runnable.run(); - } - else { - run(); - } - } - - public bool isAlive(){ - return thread.isRunning(); - } - - public bool isDaemon() { - return thread.isDaemon(); - } - - public void join(){ - thread.join(); - } - - public void setDaemon(bool on) { - thread.isDaemon(on); - } - - public void setName(String name){ - thread.name = name; - } - public String getName(){ - return thread.name; - } - - void interrupt() { - implMissing(__FILE__,__LINE__); - } - - static bool interrupted() { - implMissing(__FILE__,__LINE__); - return false; - } - - public void run(){ - // default impl, do nothing - } - public static void sleep( int time ){ - Thread.sleep(time/1000.0); - } - public Thread nativeThread(){ - assert(thread); - return thread; - } - public override char[] toString(){ - return "JThread "~thread.name; - } - public static void yield(){ - Thread.yield(); - } -} -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/src/java/lang/Thread.d Wed Mar 18 10:55:25 2009 +0100 @@ -0,0 +1,136 @@ +module java.lang.Thread; + +static import tango.core.Thread; +import java.lang.util; +import java.lang.Runnable; + +class Thread { + + private tango.core.Thread.Thread thread; + private Runnable runnable; + + private alias tango.core.Thread.ThreadLocal!(Thread) TTLS; + private static TTLS tls; + + public static const int MAX_PRIORITY = 10; + public static const int MIN_PRIORITY = 1; + public static const int NORM_PRIORITY = 5; + + private static TTLS getTls(){ + if( tls is null ){ + synchronized( Thread.classinfo ){ + if( tls is null ){ + tls = new TTLS(); + } + } + } + return tls; + } + + public this(){ + thread = new tango.core.Thread.Thread(&internalRun); + } + public this( void delegate() dg ){ + thread = new tango.core.Thread.Thread(&internalRun); + runnable = dgRunnable( dg ); + } + public this(Runnable runnable){ + thread = new tango.core.Thread.Thread(&internalRun); + this.runnable = runnable; + } + public this(Runnable runnable, String name){ + thread = new tango.core.Thread.Thread(&internalRun); + this.runnable = runnable; + thread.name = name; + } + public this(String name){ + thread = new tango.core.Thread.Thread(&internalRun); + thread.name = name; + } + + public void start(){ + thread.start(); + } + + public static Thread currentThread(){ + auto res = getTls().val(); + if( res is null ){ + // no synchronized needed + res = new Thread(); + res.thread = tango.core.Thread.Thread.getThis(); + getTls().val( res ); + } + assert( res ); + return res; + } + public int getPriority() { + return (thread.priority-tango.core.Thread.Thread.PRIORITY_MIN) * (MAX_PRIORITY-MIN_PRIORITY) / (tango.core.Thread.Thread.PRIORITY_MAX-tango.core.Thread.Thread.PRIORITY_MIN) + MIN_PRIORITY; + } + public void setPriority( int newPriority ) { +// assert( MIN_PRIORITY < MAX_PRIORITY ); +// assert( tango.core.Thread.Thread.PRIORITY_MIN < tango.core.Thread.Thread.PRIORITY_MAX ); + auto scaledPrio = (newPriority-MIN_PRIORITY) * (tango.core.Thread.Thread.PRIORITY_MAX-tango.core.Thread.Thread.PRIORITY_MIN) / (MAX_PRIORITY-MIN_PRIORITY) +tango.core.Thread.Thread.PRIORITY_MIN; + getDwtLogger().trace( __FILE__, __LINE__, "Thread.setPriority: scale ({} {} {}) -> ({} {} {})", MIN_PRIORITY, newPriority, MAX_PRIORITY, tango.core.Thread.Thread.PRIORITY_MIN, scaledPrio, tango.core.Thread.Thread.PRIORITY_MAX); +// thread.priority( scaledPrio ); + } + + private void internalRun(){ + getTls().val( this ); + if( runnable !is null ){ + runnable.run(); + } + else { + run(); + } + } + + public bool isAlive(){ + return thread.isRunning(); + } + + public bool isDaemon() { + return thread.isDaemon(); + } + + public void join(){ + thread.join(); + } + + public void setDaemon(bool on) { + thread.isDaemon(on); + } + + public void setName(String name){ + thread.name = name; + } + public String getName(){ + return thread.name; + } + + void interrupt() { + implMissing(__FILE__,__LINE__); + } + + static bool interrupted() { + implMissing(__FILE__,__LINE__); + return false; + } + + public void run(){ + // default impl, do nothing + } + public static void sleep( int time ){ + tango.core.Thread.Thread.sleep(time/1000.0); + } + public tango.core.Thread.Thread nativeThread(){ + assert(thread); + return thread; + } + public override char[] toString(){ + return "Thread "~thread.name; + } + public static void yield(){ + tango.core.Thread.Thread.yield(); + } +} +
--- a/java/src/java/util/Timer.d Wed Mar 18 09:57:53 2009 +0100 +++ b/java/src/java/util/Timer.d Wed Mar 18 10:55:25 2009 +0100 @@ -2,7 +2,7 @@ import java.util.TimerTask; // import tango.util.container.CircularList; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; // import tango.time.Time; @@ -207,7 +207,7 @@ private static int nr; private TaskQueue queue; private Scheduler scheduler; - private JThread thread; + private Thread thread; private bool canceled; public this() { @@ -215,7 +215,7 @@ } public this(bool daemon) { - this(daemon, JThread.NORM_PRIORITY); + this(daemon, Thread.NORM_PRIORITY); } private this(bool daemon, int priority) { @@ -226,7 +226,7 @@ canceled = false; queue = new TaskQueue(); scheduler = new Scheduler(queue); - thread = new JThread(scheduler, name); + thread = new Thread(scheduler, name); thread.setDaemon(daemon); thread.setPriority(priority); thread.start(); @@ -315,7 +315,7 @@ /////////////////////////////////////////////////// /+ alias CircularList!( TimerTask ) ListType; - private JThread thread; + private Thread thread; private ListType schedules; private Mutex mutex; private Condition cond; @@ -329,7 +329,7 @@ cond = new Condition( mutex ); schedules = new ListType(); - thread = new JThread( &run ); + thread = new Thread( &run ); thread.setDaemon( isDaemon ); thread.start(); }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Deadlock.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Deadlock.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.Deadlock; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; @@ -26,13 +26,13 @@ */ class Deadlock { //all the threads which are involved in the deadlock - private JThread[] threads; + private Thread[] threads; //the thread whose locks will be suspended to resolve deadlock - private JThread candidate; + private Thread candidate; //the locks that will be suspended private ISchedulingRule[] locks; - public this(JThread[] threads, ISchedulingRule[] locks, JThread candidate) { + public this(Thread[] threads, ISchedulingRule[] locks, Thread candidate) { this.threads = threads; this.locks = locks; this.candidate = candidate; @@ -42,11 +42,11 @@ return locks; } - public JThread getCandidate() { + public Thread getCandidate() { return candidate; } - public JThread[] getThreads() { + public Thread[] getThreads() { return threads; } }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/DeadlockDetector.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/DeadlockDetector.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.DeadlockDetector; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.ArrayList; @@ -100,9 +100,9 @@ * are actually deadlocked with the current thread. * Add the threads that form deadlock to the deadlockedThreads list. */ - private bool addCycleThreads(ArrayList deadlockedThreads, JThread next) { + private bool addCycleThreads(ArrayList deadlockedThreads, Thread next) { //get the thread that block the given thread from running - JThread[] blocking = blockingThreads(next); + Thread[] blocking = blockingThreads(next); //if the thread is not blocked by other threads, then it is not part of a deadlock if (blocking.length is 0) return false; @@ -127,7 +127,7 @@ /** * Get the thread(s) that own the lock this thread is waiting for. */ - private JThread[] blockingThreads(JThread current) { + private Thread[] blockingThreads(Thread current) { //find the lock this thread is waiting for ISchedulingRule lock = cast(ISchedulingRule) getWaitingLock(current); return getThreadsOwningLock(lock); @@ -166,7 +166,7 @@ * Returns true IFF the matrix contains a row for the given thread. * (meaning the given thread either owns locks or is waiting for locks) */ - bool contains(JThread t) { + bool contains(Thread t) { return lockThreads.contains(t); } @@ -199,7 +199,7 @@ /** * Returns all the locks owned by the given thread */ - private Object[] getOwnedLocks(JThread current) { + private Object[] getOwnedLocks(Thread current) { ArrayList ownedLocks = new ArrayList(1); int index = indexOf(current, false); @@ -215,7 +215,7 @@ /** * Returns an array of threads that form the deadlock (usually 2). */ - private JThread[] getThreadsInDeadlock(JThread cause) { + private Thread[] getThreadsInDeadlock(Thread cause) { ArrayList deadlockedThreads = new ArrayList(2); /** * if the thread that caused deadlock doesn't own any locks, then it is not part @@ -224,15 +224,15 @@ if (ownsLocks(cause)) deadlockedThreads.add(cause); addCycleThreads(deadlockedThreads, cause); - return arraycast!(JThread)( deadlockedThreads.toArray()); + return arraycast!(Thread)( deadlockedThreads.toArray()); } /** * Returns the thread(s) that own the given lock. */ - private JThread[] getThreadsOwningLock(ISchedulingRule rule) { + private Thread[] getThreadsOwningLock(ISchedulingRule rule) { if (rule is null) - return new JThread[0]; + return new Thread[0]; int lockIndex = indexOf(rule, false); ArrayList blocking = new ArrayList(1); for (int i = 0; i < graph.length; i++) { @@ -243,13 +243,13 @@ getDwtLogger.info( __FILE__, __LINE__, "Lock {} is involved in deadlock but is not owned by any thread.", rule ); //$NON-NLS-1$ //$NON-NLS-2$ if ((blocking.size() > 1) && (cast(ILock)rule ) && (JobManager.DEBUG_LOCKS)) getDwtLogger.info( __FILE__, __LINE__, "Lock {} is owned by more than 1 thread, but it is not a rule.", rule ); //$NON-NLS-1$ //$NON-NLS-2$ - return arraycast!(JThread)( blocking.toArray()); + return arraycast!(Thread)( blocking.toArray()); } /** * Returns the lock the given thread is waiting for. */ - private Object getWaitingLock(JThread current) { + private Object getWaitingLock(Thread current) { int index = indexOf(current, false); //find the lock that this thread is waiting for for (int j = 0; j < graph[index].length; j++) { @@ -278,7 +278,7 @@ * Returns the index of the given thread in the thread array. If the thread * is not present in the array, it is added to the end. */ - private int indexOf(JThread owner, bool add) { + private int indexOf(Thread owner, bool add) { int index = lockThreads.indexOf(owner); if ((index < 0) && add) { lockThreads.add(owner); @@ -298,7 +298,7 @@ /** * The given lock was acquired by the given thread. */ - void lockAcquired(JThread owner, ISchedulingRule lock) { + void lockAcquired(Thread owner, ISchedulingRule lock) { int lockIndex = indexOf(lock, true); int threadIndex = indexOf(owner, true); if (resize) @@ -332,7 +332,7 @@ /** * The given lock was released by the given thread. Update the graph. */ - void lockReleased(JThread owner, ISchedulingRule lock) { + void lockReleased(Thread owner, ISchedulingRule lock) { int lockIndex = indexOf(lock, false); int threadIndex = indexOf(owner, false); //make sure the lock and thread exist in the graph @@ -372,7 +372,7 @@ * The given scheduling rule is no longer used because the job that invoked it is done. * Release this rule regardless of how many times it was acquired. */ - void lockReleasedCompletely(JThread owner, ISchedulingRule rule) { + void lockReleasedCompletely(Thread owner, ISchedulingRule rule) { int ruleIndex = indexOf(rule, false); int threadIndex = indexOf(owner, false); //need to make sure that the given thread and rule were not already removed from the graph @@ -402,7 +402,7 @@ * The given thread could not get the given lock and is waiting for it. * Update the graph. */ - Deadlock lockWaitStart(JThread client, ISchedulingRule lock) { + Deadlock lockWaitStart(Thread client, ISchedulingRule lock) { setToWait(client, lock, false); int lockIndex = indexOf(lock, false); int[] temp = new int[lockThreads.size()]; @@ -410,8 +410,8 @@ if (!checkWaitCycles(temp, lockIndex)) return null; //there is a deadlock in the graph - JThread[] threads = getThreadsInDeadlock(client); - JThread candidate = resolutionCandidate(threads); + Thread[] threads = getThreadsInDeadlock(client); + Thread candidate = resolutionCandidate(threads); ISchedulingRule[] locksToSuspend = realLocksForThread(candidate); Deadlock deadlock = new Deadlock(threads, locksToSuspend, candidate); //find a thread whose locks can be suspended to resolve the deadlock @@ -431,7 +431,7 @@ * The given thread has stopped waiting for the given lock. * Update the graph. */ - void lockWaitStop(JThread owner, ISchedulingRule lock) { + void lockWaitStop(Thread owner, ISchedulingRule lock) { int lockIndex = indexOf(lock, false); int threadIndex = indexOf(owner, false); //make sure the thread and lock exist in the graph @@ -454,7 +454,7 @@ /** * Returns true IFF the given thread owns a single lock */ - private bool ownsLocks(JThread cause) { + private bool ownsLocks(Thread cause) { int threadIndex = indexOf(cause, false); for (int j = 0; j < graph[threadIndex].length; j++) { if (graph[threadIndex][j] > NO_STATE) @@ -467,7 +467,7 @@ * Returns true IFF the given thread owns a single real lock. * A real lock is a lock that can be suspended. */ - private bool ownsRealLocks(JThread owner) { + private bool ownsRealLocks(Thread owner) { int threadIndex = indexOf(owner, false); for (int j = 0; j < graph[threadIndex].length; j++) { if (graph[threadIndex][j] > NO_STATE) { @@ -483,7 +483,7 @@ * Return true IFF this thread owns rule locks (i.e. implicit locks which * cannot be suspended) */ - private bool ownsRuleLocks(JThread owner) { + private bool ownsRuleLocks(Thread owner) { int threadIndex = indexOf(owner, false); for (int j = 0; j < graph[threadIndex].length; j++) { if (graph[threadIndex][j] > NO_STATE) { @@ -499,7 +499,7 @@ * Returns an array of real locks that are owned by the given thread. * Real locks are locks that implement the ILock interface and can be suspended. */ - private ISchedulingRule[] realLocksForThread(JThread owner) { + private ISchedulingRule[] realLocksForThread(Thread owner) { int threadIndex = indexOf(owner, false); ArrayList ownedLocks = new ArrayList(1); for (int j = 0; j < graph[threadIndex].length; j++) { @@ -608,7 +608,7 @@ private void reportDeadlock(Deadlock deadlock) { String msg = "Deadlock detected. All locks owned by thread " ~ deadlock.getCandidate().getName() ~ " will be suspended."; //$NON-NLS-1$ //$NON-NLS-2$ MultiStatus main = new MultiStatus(JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, new IllegalStateException()); - JThread[] threads = deadlock.getThreads(); + Thread[] threads = deadlock.getThreads(); for (int i = 0; i < threads.length; i++) { Object[] ownedLocks = getOwnedLocks(threads[i]); Object waitLock = getWaitingLock(threads[i]); @@ -653,7 +653,7 @@ * Get the thread whose locks can be suspended. (i.e. all locks it owns are * actual locks and not rules). Return the first thread in the array by default. */ - private JThread resolutionCandidate(JThread[] candidates) { + private Thread resolutionCandidate(Thread[] candidates) { //first look for a candidate that has no scheduling rules for (int i = 0; i < candidates.length; i++) { if (!ownsRuleLocks(candidates[i])) @@ -671,7 +671,7 @@ /** * The given thread is waiting for the given lock. Update the graph. */ - private void setToWait(JThread owner, ISchedulingRule lock, bool suspend) { + private void setToWait(Thread owner, ISchedulingRule lock, bool suspend) { bool needTransfer = false; /** * if we are adding an entry where a thread is waiting on a scheduling rule, @@ -705,7 +705,7 @@ sb.append("\n"); for (int i = 0; i < graph.length; i++) { sb.append(" "); - sb.append( (cast(JThread) lockThreads.get(i)).getName() ); + sb.append( (cast(Thread) lockThreads.get(i)).getName() ); sb.append(" : "); for (int j = 0; j < graph[i].length; j++) { sb.append(" ");
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/ImplicitJobs.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/ImplicitJobs.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.ImplicitJobs; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Iterator; import java.util.Map; @@ -67,7 +67,7 @@ void begin(ISchedulingRule rule, IProgressMonitor monitor, bool suspend) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug_(Format("Begin rule: {}", rule)); //$NON-NLS-1$ - final JThread getThis = JThread.currentThread(); + final Thread getThis = Thread.currentThread(); ThreadJob threadJob; synchronized (this) { threadJob = cast(ThreadJob) threadJobs.get(getThis); @@ -100,7 +100,7 @@ if (threadJob.acquireRule) { //no need to re-acquire any locks because the thread did not wait to get this lock if (manager.runNow_package(threadJob)) - manager.getLockManager().addLockThread(JThread.currentThread(), rule); + manager.getLockManager().addLockThread(Thread.currentThread(), rule); else threadJob = threadJob.joinRun(monitor); } @@ -126,7 +126,7 @@ synchronized void end(ISchedulingRule rule, bool resume) { if (JobManager.DEBUG_BEGIN_END) JobManager.debug_(Format("End rule: {}", rule)); //$NON-NLS-1$ - ThreadJob threadJob = cast(ThreadJob) threadJobs.get(JThread.currentThread()); + ThreadJob threadJob = cast(ThreadJob) threadJobs.get(Thread.currentThread()); if (threadJob is null) Assert.isLegal(rule is null, Format("endRule without matching beginRule: {}", rule)); //$NON-NLS-1$ else if (threadJob.pop(rule)) { @@ -140,7 +140,7 @@ * @param lastJob The last job to run in this thread */ void endJob(InternalJob lastJob) { - final JThread getThis = JThread.currentThread(); + final Thread getThis = Thread.currentThread(); IStatus error; synchronized (this) { ThreadJob threadJob = cast(ThreadJob) threadJobs.get(getThis); @@ -163,7 +163,7 @@ } private void endThreadJob(ThreadJob threadJob, bool resume) { - JThread getThis = JThread.currentThread(); + Thread getThis = Thread.currentThread(); //clean up when last rule scope exits threadJobs.remove(getThis); ISchedulingRule rule = threadJob.getRule(); @@ -253,11 +253,11 @@ /** * Implements IJobManager#transferRule(ISchedulingRule, Thread) */ - synchronized void transfer(ISchedulingRule rule, JThread destinationThread) { + synchronized void transfer(ISchedulingRule rule, Thread destinationThread) { //nothing to do for null if (rule is null) return; - JThread getThis = JThread.currentThread(); + Thread getThis = Thread.currentThread(); //nothing to do if transferring to the same thread if (getThis is destinationThread) return;
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/InternalJob.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/InternalJob.d Wed Mar 18 10:55:25 2009 +0100 @@ -15,7 +15,7 @@ import java.lang.all; import java.util.Map; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IProgressMonitor; @@ -128,7 +128,7 @@ /* * The thread that is currently running this job */ - private /+volatile+/ JThread thread = null; + private /+volatile+/ Thread thread = null; protected this(String name) { Assert.isNotNull(name); @@ -293,10 +293,10 @@ /* (non-javadoc) * @see Job.getThread */ - protected JThread getThread() { + protected Thread getThread() { return thread; } - package JThread getThread_package() { + package Thread getThread_package() { return getThread(); } @@ -564,10 +564,10 @@ /* (non-javadoc) * @see Job.setThread */ - protected void setThread(JThread thread) { + protected void setThread(Thread thread) { this.thread = thread; } - package void setThread_package(JThread thread) { + package void setThread_package(Thread thread) { setThread(thread); }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobManager.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobManager.d Wed Mar 18 10:55:25 2009 +0100 @@ -21,7 +21,7 @@ import java.util.HashSet; import tango.time.WallClock; import tango.time.Time; -import java.lang.JThread; +import java.lang.Thread; //don't use ICU because this is used for debugging only (see bug 135785) // import java.text.DateFormat; @@ -195,7 +195,7 @@ msgBuf.append('-'); } msgBuf.append('['); - msgBuf.append(JThread.currentThread().toString()); + msgBuf.append(Thread.currentThread().toString()); msgBuf.append(']'); msgBuf.append(msg); getDwtLogger.info( __FILE__, __LINE__, "{}", msgBuf.toString()); @@ -469,7 +469,7 @@ * @see org.eclipse.core.runtime.jobs.IJobManager#currentJob() */ public Job currentJob() { - JThread current = JThread.currentThread(); + Thread current = Thread.currentThread(); if (cast(Worker)current ) return (cast(Worker) current).currentJob(); synchronized (lock) { @@ -553,7 +553,7 @@ } for (int waitAttempts = 0; waitAttempts < 3; waitAttempts++) { - JThread.yield(); + Thread.yield(); synchronized (lock) { if (running.isEmpty()) break; @@ -571,11 +571,11 @@ } } try { - JThread.sleep(100); + Thread.sleep(100); } catch (InterruptedException e) { //ignore } - JThread.yield(); + Thread.yield(); } synchronized (lock) { // retrieve list of the jobs that are still running @@ -776,7 +776,7 @@ if (suspended && state !is Job.RUNNING) return; //it's an error for a job to join itself - if (state is Job.RUNNING && job.getThread_package() is JThread.currentThread()) + if (state is Job.RUNNING && job.getThread_package() is Thread.currentThread()) throw new IllegalStateException("Job attempted to join itself"); //$NON-NLS-1$ //the semaphore will be released when the job is done barrier = new Semaphore(null); @@ -881,13 +881,13 @@ monitor.subTask(NLS.bind(JobMessages.jobs_waitFamSub, Integer.toString(jobsLeft))); } - if (JThread.interrupted()) + if (Thread.interrupted()) throw new InterruptedException(); if (monitor.isCanceled()) throw new OperationCanceledException(); //notify hook to service pending syncExecs before falling asleep lockManager.aboutToWait(null); - JThread.sleep(100); + Thread.sleep(100); } } finally { lockManager.aboutToRelease(); @@ -1303,7 +1303,7 @@ /* non-Javadoc) * @see org.eclipse.core.runtime.jobs.IJobManager#transferRule() */ - public void transferRule(ISchedulingRule rule, JThread destinationThread) { + public void transferRule(ISchedulingRule rule, Thread destinationThread) { implicitJobs.transfer(rule, destinationThread); }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobMessages.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobMessages.d Wed Mar 18 10:55:25 2009 +0100 @@ -11,7 +11,7 @@ **********************************************************************/ module org.eclipse.core.internal.jobs.JobMessages; -import java.lang.JThread; +import java.lang.Thread; import tango.time.WallClock; import tango.text.convert.TimeStamp; @@ -53,7 +53,7 @@ char[30] buf; buffer.append(tango.text.convert.TimeStamp.format( buf, WallClock.now())); buffer.append(" - ["); //$NON-NLS-1$ - buffer.append(JThread.currentThread().getName()); + buffer.append(Thread.currentThread().getName()); buffer.append("] "); //$NON-NLS-1$ buffer.append(message); getDwtLogger.info( __FILE__, __LINE__, buffer.toString());
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/LockManager.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/LockManager.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.LockManager; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Stack; import java.util.HashMap; @@ -117,7 +117,7 @@ /* (non-Javadoc) * Method declared on LockListener */ - public bool aboutToWait(JThread lockOwner) { + public bool aboutToWait(Thread lockOwner) { if (lockListener is null) return false; try { @@ -133,7 +133,7 @@ /** * This thread has just acquired a lock. Update graph. */ - void addLockThread(JThread thread, ISchedulingRule lock) { + void addLockThread(Thread thread, ISchedulingRule lock) { if (locks is null) return; try { @@ -148,7 +148,7 @@ /** * This thread has just been refused a lock. Update graph and check for deadlock. */ - void addLockWaitThread(JThread thread, ISchedulingRule lock) { + void addLockWaitThread(Thread thread, ISchedulingRule lock) { if (locks is null) return; try { @@ -222,13 +222,13 @@ public bool isLockOwner() { //all job threads have to be treated as lock owners because UI thread //may try to join a job - JThread current = JThread.currentThread(); + Thread current = Thread.currentThread(); if (cast(Worker)current ) return true; if (locks is null) return false; synchronized (locks) { - return locks.contains(JThread.currentThread()); + return locks.contains(Thread.currentThread()); } } @@ -242,7 +242,7 @@ /** * Releases all the acquires that were called on the given rule. Needs to be called only once. */ - void removeLockCompletely(JThread thread, ISchedulingRule rule) { + void removeLockCompletely(Thread thread, ISchedulingRule rule) { if (locks is null) return; try { @@ -257,7 +257,7 @@ /** * This thread has just released a lock. Update graph. */ - void removeLockThread(JThread thread, ISchedulingRule lock) { + void removeLockThread(Thread thread, ISchedulingRule lock) { try { synchronized (locks) { locks.lockReleased(thread, lock); @@ -270,7 +270,7 @@ /** * This thread has just stopped waiting for a lock. Update graph. */ - void removeLockWaitThread(JThread thread, ISchedulingRule lock) { + void removeLockWaitThread(Thread thread, ISchedulingRule lock) { try { synchronized (locks) { locks.lockWaitStop(thread, lock); @@ -283,7 +283,7 @@ /** * Resumes all the locks that were suspended while this thread was waiting to acquire another lock. */ - void resumeSuspendedLocks(JThread owner) { + void resumeSuspendedLocks(Thread owner) { LockState[] toResume; synchronized (suspendedLocks) { Stack prevLocks = cast(Stack) suspendedLocks.get(owner);
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/OrderedLock.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/OrderedLock.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.OrderedLock; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Set; @@ -52,7 +52,7 @@ /** * The thread of the operation that currently owns the lock. */ - private /+volatile+/ JThread currentOperationThread; + private /+volatile+/ Thread currentOperationThread; /** * Records the number of successive acquires in the same * thread. The lock is released only when the depth @@ -115,13 +115,13 @@ if (semaphore is null) return true; if (DEBUG) - getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation waiting to be executed... ", JThread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ + getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation waiting to be executed... ", Thread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ success = doAcquire(semaphore, delay); - manager.resumeSuspendedLocks(JThread.currentThread()); + manager.resumeSuspendedLocks(Thread.currentThread()); if (DEBUG && success) - getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation started... ", JThread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ + getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation started... ", Thread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ else if (DEBUG) - getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation timed out... ", JThread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ + getDwtLogger.info( __FILE__, __LINE__, "[{}] Operation timed out... ", Thread.currentThread(), this); //$NON-NLS-1$ //$NON-NLS-2$ return success; } @@ -132,9 +132,9 @@ private synchronized bool attempt() { //return true if we already own the lock //also, if nobody is waiting, grant the lock immediately - if ((currentOperationThread is JThread.currentThread()) || (currentOperationThread is null && operations.isEmpty())) { + if ((currentOperationThread is Thread.currentThread()) || (currentOperationThread is null && operations.isEmpty())) { depth++; - setCurrentOperationThread(JThread.currentThread()); + setCurrentOperationThread(Thread.currentThread()); return true; } return false; @@ -153,7 +153,7 @@ * otherwise a new semaphore will be created, enqueued, and returned. */ private synchronized Semaphore createSemaphore() { - return attempt() ? null : enqueue(new Semaphore(JThread.currentThread())); + return attempt() ? null : enqueue(new Semaphore(Thread.currentThread())); } /** @@ -178,12 +178,12 @@ semaphore = createSemaphore(); if (semaphore is null) return true; - manager.addLockWaitThread(JThread.currentThread(), this); + manager.addLockWaitThread(Thread.currentThread(), this); try { success = semaphore.acquire(delay); } catch (InterruptedException e) { if (DEBUG) - getDwtLogger.info( __FILE__, __LINE__, Format("[{}] Operation interrupted while waiting... :-|", JThread.currentThread())); //$NON-NLS-1$ //$NON-NLS-2$ + getDwtLogger.info( __FILE__, __LINE__, Format("[{}] Operation interrupted while waiting... :-|", Thread.currentThread())); //$NON-NLS-1$ //$NON-NLS-2$ throw e; } if (success) { @@ -191,7 +191,7 @@ updateCurrentOperation(); } else { removeFromQueue(semaphore); - manager.removeLockWaitThread(JThread.currentThread(), this); + manager.removeLockWaitThread(Thread.currentThread(), this); } return success; } @@ -277,7 +277,7 @@ * If newThread is null, release this lock from its previous owner. * If newThread is not null, grant this lock to newThread. */ - private void setCurrentOperationThread(JThread newThread) { + private void setCurrentOperationThread(Thread newThread) { if ((currentOperationThread !is null) && (newThread is null)) manager.removeLockThread(currentOperationThread, this); this.currentOperationThread = newThread; @@ -312,6 +312,6 @@ */ private synchronized void updateCurrentOperation() { operations.dequeue(); - setCurrentOperationThread(JThread.currentThread()); + setCurrentOperationThread(Thread.currentThread()); } }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Semaphore.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Semaphore.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,19 +12,19 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.Semaphore; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; import java.lang.all; public class Semaphore { protected long notifications; - protected JThread runnable; + protected Thread runnable; private Mutex mutex; private Condition condition; - public this(JThread runnable) { + public this(Thread runnable) { mutex = new Mutex; condition = new Condition(mutex); this.runnable = runnable;
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/ThreadJob.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/ThreadJob.d Wed Mar 18 10:55:25 2009 +0100 @@ -14,7 +14,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -177,7 +177,7 @@ throw new OperationCanceledException(); //check if there is a blocking thread before waiting InternalJob blockingJob = manager.findBlockingJob_package(this); - JThread blocker = blockingJob is null ? null : blockingJob.getThread_package(); + Thread blocker = blockingJob is null ? null : blockingJob.getThread_package(); ThreadJob result = this; try { //just return if lock listener decided to grant immediate access @@ -185,7 +185,7 @@ return this; try { waitStart(monitor, blockingJob); - final JThread getThis = JThread.currentThread(); + final Thread getThis = Thread.currentThread(); while (true) { if (isCanceled(monitor)) throw new OperationCanceledException(); @@ -321,7 +321,7 @@ */ private void waitEnd(IProgressMonitor monitor) { final LockManager lockManager = manager.getLockManager(); - final JThread getThis = JThread.currentThread(); + final Thread getThis = Thread.currentThread(); if (isRunning()) { lockManager.addLockThread(getThis, getRule()); //need to re-acquire any locks that were suspended while this thread was blocked on the rule @@ -339,7 +339,7 @@ * @param blockingJob The job that is blocking this thread, or <code>null</code> */ private void waitStart(IProgressMonitor monitor, InternalJob blockingJob) { - manager.getLockManager().addLockWaitThread(JThread.currentThread(), getRule()); + manager.getLockManager().addLockWaitThread(Thread.currentThread(), getRule()); isBlocked = true; manager.reportBlocked(monitor, blockingJob); }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Worker.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/Worker.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.Worker; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Set; @@ -32,7 +32,7 @@ * A worker thread processes jobs supplied to it by the worker pool. When * the worker pool gives it a null job, the worker dies. */ -public class Worker : JThread { +public class Worker : Thread { //worker number used for debugging purposes only private static int nextWorkerNumber = 0; private /+volatile+/ InternalJob currentJob_; @@ -80,7 +80,7 @@ // result = handleException(currentJob_, e); } finally { //clear interrupted state for this thread - JThread.interrupted(); + Thread.interrupted(); //result must not be null if (result is null)
--- a/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/WorkerPool.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/WorkerPool.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.internal.jobs.WorkerPool; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; import java.lang.all; @@ -125,7 +125,7 @@ //do not become the owners of the same rule in the graph if ((job.getRule_package() !is null) && !(cast(ThreadJob)job )) { //remove any locks this thread may be owning on that rule - manager.getLockManager().removeLockCompletely(JThread.currentThread(), job.getRule_package()); + manager.getLockManager().removeLockCompletely(Thread.currentThread(), job.getRule_package()); } manager.endJob_package(job, result, true); //ensure this thread no longer owns any scheduling rules @@ -277,7 +277,7 @@ if ((job.getRule() !is null) && !(cast(ThreadJob)job )) { //don't need to re-aquire locks because it was not recorded in the graph //that this thread waited to get this rule - manager.getLockManager().addLockThread(JThread.currentThread(), job.getRule()); + manager.getLockManager().addLockThread(Thread.currentThread(), job.getRule()); } //see if we need to wake another worker if (manager.sleepHint_package() <= 0)
--- a/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobManager.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/IJobManager.d Wed Mar 18 10:55:25 2009 +0100 @@ -24,7 +24,7 @@ import org.eclipse.core.runtime.jobs.LockListener; import org.eclipse.core.runtime.jobs.ProgressProvider; -import java.lang.JThread; +import java.lang.Thread; /** * The job manager provides facilities for scheduling, querying, and maintaining jobs @@ -408,7 +408,7 @@ * @param destinationThread The new owner for the transferred rule. * @since 3.1 */ - public void transferRule(ISchedulingRule rule, JThread destinationThread); + public void transferRule(ISchedulingRule rule, Thread destinationThread); /** * Resumes scheduling of all sleeping jobs in the given family. This method
--- a/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/Job.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/Job.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.runtime.jobs.Job; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Set; @@ -336,7 +336,7 @@ * @return the thread this job is running in, or <code>null</code> * if this job is not running or the thread is unknown. */ - public final JThread getThread() { + public final Thread getThread() { return super.getThread(); } @@ -610,7 +610,7 @@ * @see #ASYNC_FINISH * @see #run(IProgressMonitor) */ - public final void setThread(JThread thread) { + public final void setThread(Thread thread) { super.setThread(thread); }
--- a/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/LockListener.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.core.jobs/src/org/eclipse/core/runtime/jobs/LockListener.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.core.runtime.jobs.LockListener; -import java.lang.JThread; +import java.lang.Thread; import java.lang.all; import java.util.Set; @@ -50,7 +50,7 @@ * @return <code>true</code> if the thread should be granted immediate access, * and <code>false</code> if it should wait for the lock to be available */ - public bool aboutToWait(JThread lockOwner) { + public bool aboutToWait(Thread lockOwner) { return false; }
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.d Wed Mar 18 10:55:25 2009 +0100 @@ -31,7 +31,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; @@ -60,14 +60,14 @@ private class Summarizer { - JThread thread; + Thread thread; private bool fReset= true; /** * Creates a new thread. */ public this() { - thread = new JThread( &run ); + thread = new Thread( &run ); fProgressMonitor= new NullProgressMonitor(); // might be given by client in the future thread.setDaemon(true); thread.start();
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.d Wed Mar 18 10:55:25 2009 +0100 @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import tango.core.Exception;
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/SubstitutionTextReader.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/SubstitutionTextReader.d Wed Mar 18 10:55:25 2009 +0100 @@ -24,7 +24,6 @@ import java.lang.all; import java.io.Reader; import java.util.Set; -import tango.core.Exception; /** * Reads the text contents from a reader and computes for each character
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/AdditionalInfoController2.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/AdditionalInfoController2.d Wed Mar 18 10:55:25 2009 +0100 @@ -26,7 +26,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -75,7 +75,7 @@ /** The proposal table */ private Table fProposalTable; /** The thread controlling the delayed display of the additional info */ - private JThread fThread; + private Thread fThread; /** Indicates whether the display delay has been reset */ private bool fIsReset= false; /** Object to synchronize display thread and table selection changes */ @@ -127,7 +127,7 @@ synchronized (fThreadAccess) { if (fThread !is null) fThread.interrupt(); - fThread= new JThread(this, ContentAssistMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ + fThread= new Thread(this, ContentAssistMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ fStartSignal= new Mutex(); fStartSignal_cond= new Condition(fStartSignal); @@ -206,7 +206,7 @@ synchronized (fThreadAccess) { // only null fThread if it is us! - if (JThread.currentThread() is fThread) + if (Thread.currentThread() is fThread) fThread= null; } }
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContentAssistant2.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContentAssistant2.d Wed Mar 18 10:55:25 2009 +0100 @@ -30,7 +30,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -238,7 +238,7 @@ */ class AutoAssistListener : VerifyKeyListener, Runnable { - private JThread fThread; + private Thread fThread; private bool fIsReset= false; private Mutex fMutex; private Condition fMutex_cond; @@ -254,7 +254,7 @@ protected void start(int showStyle) { fShowStyle= showStyle; - fThread= new JThread(this); + fThread= new Thread(this); fThread.setName( ContentAssistMessages.getString("ContentAssistant.assist_delay_timer_name")); //$NON-NLS-1$ fThread.start(); } @@ -287,7 +287,7 @@ } protected void stop() { - JThread threadToStop= fThread; + Thread threadToStop= fThread; if (threadToStop !is null) threadToStop.interrupt(); }
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.d Wed Mar 18 10:55:25 2009 +0100 @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import tango.core.Exception; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.core.runtime.Assert;
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.d Wed Mar 18 10:55:25 2009 +0100 @@ -156,7 +156,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import tango.core.Exception; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyleRange;
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.d Wed Mar 18 10:55:25 2009 +0100 @@ -162,7 +162,7 @@ import java.util.Set; import java.util.HashSet; import java.util.regex.PatternSyntaxException; -import java.lang.JThread; +import java.lang.Thread; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.LineBackgroundEvent; @@ -4349,7 +4349,7 @@ styledTextPrinter.run(); printer.dispose(); } - JThread printingThread= new JThread( &threadrun ); + Thread printingThread= new Thread( &threadrun ); printingThread.setName( "Printing" ); //$NON-NLS-1$ printingThread.start(); }
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewerHoverManager.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewerHoverManager.d Wed Mar 18 10:55:25 2009 +0100 @@ -155,7 +155,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.MouseEvent; @@ -193,7 +193,7 @@ /** The text viewer */ private TextViewer fTextViewer; /** The hover information computation thread */ - private JThread fThread; + private Thread fThread; /** The stopper of the computation thread */ private ITextListener fStopper; /** Internal monitor */ @@ -301,7 +301,7 @@ setInformation(cast(Object)null, null); return; } - fThread= new JThread( dgRunnable( (ITextHover hover_, IRegion region_, Rectangle area_){ + fThread= new Thread( dgRunnable( (ITextHover hover_, IRegion region_, Rectangle area_){ // http://bugs.eclipse.org/bugs/show_bug.cgi?id=17693 bool hasFinished= false; try { @@ -352,7 +352,7 @@ fThread.setName( "Text Viewer Hover Presenter" ); //$NON-NLS-1$ fThread.setDaemon(true); - fThread.setPriority(JThread.MIN_PRIORITY); + fThread.setPriority(Thread.MIN_PRIORITY); synchronized (fMutex) { fTextViewer.addTextListener(fStopper); fThread.start();
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AdditionalInfoController.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AdditionalInfoController.d Wed Mar 18 10:55:25 2009 +0100 @@ -46,7 +46,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -285,7 +285,7 @@ } /** The timer thread. */ - private const JThread fThread; + private const Thread fThread; /** The currently waiting / active task. */ private Task fTask; @@ -321,7 +321,7 @@ long current= System.currentTimeMillis(); schedule(IDLE, current); - fThread= new JThread( &threadrun ); + fThread= new Thread( &threadrun ); fThread.setName( JFaceTextMessages.getString("InfoPopup.info_delay_timer_name")); //$NON-NLS-1$ fThread.start(); }
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.d Wed Mar 18 10:55:25 2009 +0100 @@ -52,7 +52,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -287,7 +287,7 @@ super.keyReleased(e); } - private JThread fThread; + private Thread fThread; private bool fIsReset= false; private Mutex fMutex; private Condition fMutex_cond; @@ -303,7 +303,7 @@ protected void start(int showStyle) { fShowStyle= showStyle; - fThread= new JThread(this); + fThread= new Thread(this); fThread.setName( JFaceTextMessages.getString("ContentAssistant.assist_delay_timer_name")); //$NON-NLS-1$ fThread.start(); } @@ -336,7 +336,7 @@ } protected void stop() { - JThread threadToStop= fThread; + Thread threadToStop= fThread; if (threadToStop !is null && threadToStop.isAlive()) threadToStop.interrupt(); }
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.d Wed Mar 18 10:55:25 2009 +0100 @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import tango.core.Exception; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.Position;
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/AbstractReconciler.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/AbstractReconciler.d Wed Mar 18 10:55:25 2009 +0100 @@ -28,7 +28,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IProgressMonitor; @@ -70,7 +70,7 @@ * Background thread for the reconciling activity. */ class BackgroundThread { - JThread thread; + Thread thread; /** Has the reconciler been canceled. */ private bool fCanceled= false; @@ -88,9 +88,9 @@ * @param name the thread's name */ public this(String name) { - thread = new JThread( &run ); + thread = new Thread( &run ); thread.setName( name ); - thread.setPriority( JThread.MIN_PRIORITY ); + thread.setPriority( Thread.MIN_PRIORITY ); thread.setDaemon(true); } @@ -100,7 +100,7 @@ public bool isAlive(){ return thread.isAlive(); } - public JThread getThread(){ + public Thread getThread(){ return thread; } /** @@ -266,7 +266,7 @@ public void documentChanged(DocumentEvent e) { if (!fThread.isDirty() && fThread.isAlive()) { - if (!fIsAllowedToModifyDocument && JThread.currentThread() is fThread.getThread()) + if (!fIsAllowedToModifyDocument && Thread.currentThread() is fThread.getThread()) throw new UnsupportedOperationException("The reconciler thread is not allowed to modify the document"); //$NON-NLS-1$ aboutToBeReconciled(); } @@ -631,6 +631,6 @@ * @since 3.4 */ protected bool isRunningInReconcilerThread() { - return JThread.currentThread() is fThread.getThread(); + return Thread.currentThread() is fThread.getThread(); } }
--- a/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.d Wed Mar 18 10:55:25 2009 +0100 @@ -51,7 +51,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; /** * A contribution item which delegates to an action. @@ -186,7 +186,7 @@ if (isVisible() && widget !is null) { Display display = widget.getDisplay(); - if (display.getThread() is JThread.currentThread().nativeThread()) { + if (display.getThread() is Thread.currentThread().nativeThread()) { update(e.getProperty()); } else { display.asyncExec(dgRunnable( (PropertyChangeEvent e_) {
--- a/org.eclipse.jface/src/org/eclipse/jface/action/ContributionManager.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/action/ContributionManager.d Wed Mar 18 10:55:25 2009 +0100 @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Set; -import tango.core.Exception; /** * Abstract base class for all contribution managers, and standard
--- a/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.d Wed Mar 18 10:55:25 2009 +0100 @@ -34,7 +34,6 @@ static import tango.io.stream.Format; static import tango.io.model.IConduit; import tango.io.device.File; -import tango.core.Exception; import java.nonstandard.XmlTranscode; /**
--- a/org.eclipse.jface/src/org/eclipse/jface/dialogs/TrayDialog.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/dialogs/TrayDialog.d Wed Mar 18 10:55:25 2009 +0100 @@ -42,7 +42,6 @@ import java.lang.all; import java.util.Set; -import tango.core.Exception; /** * A <code>TrayDialog</code> is a specialized <code>Dialog</code> that can contain
--- a/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ContentProposalAdapter.d Wed Mar 18 10:55:25 2009 +0100 @@ -51,7 +51,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; /** * ContentProposalAdapter can be used to attach content proposal behavior to a @@ -933,7 +933,7 @@ pendingDescriptionUpdate = true; try { - JThread.sleep( POPUP_DELAY ); + Thread.sleep( POPUP_DELAY ); } catch (InterruptedException e) { } @@ -975,7 +975,7 @@ }); } }; - JThread t = new JThread(r); + Thread t = new Thread(r); t.start(); } } @@ -2018,7 +2018,7 @@ public void run(){ receivedKeyDown = false; try { - JThread.sleep(autoActivationDelay); + Thread.sleep(autoActivationDelay); } catch (InterruptedException e) { } if (!isValid() || receivedKeyDown) { @@ -2031,7 +2031,7 @@ }); } }; - JThread t = new JThread(r); + Thread t = new Thread(r); t.start(); } else { // Since we do not sleep, we must open the popup
--- a/org.eclipse.jface/src/org/eclipse/jface/layout/GridDataFactory.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/layout/GridDataFactory.d Wed Mar 18 10:55:25 2009 +0100 @@ -22,7 +22,6 @@ import java.lang.all; import java.util.Set; -import tango.core.Exception; /** * This class provides a convienient shorthand for creating and initializing
--- a/org.eclipse.jface/src/org/eclipse/jface/operation/IThreadListener.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/operation/IThreadListener.d Wed Mar 18 10:55:25 2009 +0100 @@ -13,7 +13,7 @@ module org.eclipse.jface.operation.IThreadListener; import java.lang.all; -import java.lang.JThread; +import java.lang.Thread; /** * A thread listener is an object that is interested in receiving notifications @@ -29,5 +29,5 @@ * * @param thread The new thread */ - public void threadChange(JThread thread); + public void threadChange(Thread thread); }
--- a/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/operation/ModalContext.d Wed Mar 18 10:55:25 2009 +0100 @@ -28,7 +28,7 @@ import java.lang.all; import java.lang.reflect.InvocationTargetException; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; /** * Utility class for supporting modal operations. The runnable passed to the @@ -67,7 +67,7 @@ /** * Thread which runs the modal context. */ - private static class ModalContextThread : JThread { + private static class ModalContextThread : Thread { /** * The operation to be run. */ @@ -98,7 +98,7 @@ * * @since 3.1 */ - private JThread callingThread; + private Thread callingThread; /** * Creates a new modal context. @@ -118,7 +118,7 @@ runnable = operation; progressMonitor = new AccumulatingProgressMonitor(monitor, display); this.display = display; - this.callingThread = JThread.currentThread(); + this.callingThread = Thread.currentThread(); } /* @@ -274,7 +274,7 @@ * context is active. */ private static ModalContextThread getCurrentModalContextThread() { - JThread t = JThread.currentThread(); + Thread t = Thread.currentThread(); if ( auto r = cast(ModalContextThread)t ) { return r; } @@ -305,7 +305,7 @@ * @return <code>true</code> if the given thread is running a modal * context, <code>false</code> if not */ - public static bool isModalContextThread(JThread thread) { + public static bool isModalContextThread(Thread thread) { return (cast(ModalContextThread)thread) !is null; } @@ -426,7 +426,7 @@ * the {@link Thread} being switched to */ static Exception invokeThreadListener(IThreadListener listener, - JThread switchingThread) { + Thread switchingThread) { try { listener.threadChange(switchingThread); // } catch (ThreadDeath e) {
--- a/org.eclipse.jface/src/org/eclipse/jface/util/Util.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/util/Util.d Wed Mar 18 10:55:25 2009 +0100 @@ -22,7 +22,6 @@ import java.lang.all; import java.util.Set; -import tango.core.Exception; private extern(C) int _d_isbaseof(ClassInfo *b, ClassInfo *c); /**
--- a/org.eclipse.jface/src/org/eclipse/jface/viewers/CustomHashtable.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/viewers/CustomHashtable.d Wed Mar 18 10:55:25 2009 +0100 @@ -20,7 +20,6 @@ import java.lang.all; import java.util.Enumeration; -import tango.core.Exception; static import tango.text.Text; alias tango.text.Text.Text!(char) StringBuffer;
--- a/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledString.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledString.d Wed Mar 18 10:55:25 2009 +0100 @@ -22,7 +22,6 @@ import java.util.List; import java.util.ArrayList; import java.util.Set; -import tango.core.Exception; /**
--- a/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/BackgroundContentProvider.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/BackgroundContentProvider.d Wed Mar 18 10:55:25 2009 +0100 @@ -30,7 +30,7 @@ import java.lang.all; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; /** * Contains the algorithm for performing background sorting and filtering in a virtual @@ -142,7 +142,7 @@ private ConcurrentTableUpdator updator; private IProgressMonitor sortingProgressMonitor; - private JThread sortThread = null; + private Thread sortThread = null; private /+volatile+/ FastProgressReporter sortMon; @@ -477,7 +477,7 @@ */ private bool sortScheduled = false; - private final class SortThread : JThread { + private final class SortThread : Thread { private this(String name) { super(name); }
--- a/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.d Wed Mar 18 10:55:25 2009 +0100 @@ -35,7 +35,7 @@ import java.lang.all; import java.util.HashMap; import java.util.Set; -import java.lang.JThread; +import java.lang.Thread; /** * This class gives implementors to provide customized tooltips for any control. * @@ -495,7 +495,7 @@ display.asyncExec(dgRunnable( delegate(Display display_, Event newEvent_) { if (IS_OSX) { try { - JThread.sleep(300); + Thread.sleep(300); } catch (InterruptedException e) { }
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/accessibility/Accessible.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/accessibility/Accessible.d Wed Mar 18 10:55:25 2009 +0100 @@ -38,7 +38,7 @@ import java.lang.all; import java.util.Vector; -import tango.core.Thread; +import java.lang.Thread; /** * Instances of this class provide a bridge between application @@ -1393,7 +1393,7 @@ /* isValidThread was copied from Widget, and rewritten to work in this package */ WINBOOL isValidThread () { - return control.getDisplay ().getThread () is Thread.getThis (); + return control.getDisplay ().getThread () is Thread.currentThread (); } }
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Clipboard.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Clipboard.d Wed Mar 18 10:55:25 2009 +0100 @@ -28,7 +28,7 @@ import org.eclipse.swt.dnd.DND; import java.lang.all; -import tango.core.Thread; +import java.lang.Thread; /** * The <code>Clipboard</code> provides a mechanism for transferring data from one @@ -74,7 +74,7 @@ display = Display.getDefault(); } } - if (display.getThread() !is Thread.getThis()) { + if (display.getThread() !is Thread.currentThread()) { DND.error(SWT.ERROR_THREAD_INVALID_ACCESS); } this.display = display; @@ -144,7 +144,7 @@ protected void checkWidget () { Display display = this.display; if (display is null) DND.error (SWT.ERROR_WIDGET_DISPOSED); - if (display.getThread() !is Thread.getThis ()) DND.error (SWT.ERROR_THREAD_INVALID_ACCESS); + if (display.getThread() !is Thread.currentThread ()) DND.error (SWT.ERROR_THREAD_INVALID_ACCESS); if (display.isDisposed()) DND.error(SWT.ERROR_WIDGET_DISPOSED); } @@ -223,7 +223,7 @@ */ public void dispose () { if (isDisposed()) return; - if (display.getThread() !is Thread.getThis ()) DND.error(SWT.ERROR_THREAD_INVALID_ACCESS); + if (display.getThread() !is Thread.currentThread ()) DND.error(SWT.ERROR_THREAD_INVALID_ACCESS); /* OleIsCurrentClipboard([in] pDataObject) * The argument pDataObject is owned by the caller so reference count does not * need to be incremented. @@ -334,7 +334,7 @@ */ int result = COM.OleGetClipboard(&dataObject); while (result !is COM.S_OK && retryCount++ < 10) { - try {Thread.sleep(0.050);} catch (Exception t) {} + try {Thread.sleep(50);} catch (Exception t) {} MSG msg; OS.PeekMessage(&msg, null, 0, 0, OS.PM_NOREMOVE | OS.PM_NOYIELD); result = COM.OleGetClipboard(&dataObject); @@ -512,7 +512,7 @@ */ int retryCount = 0; while (result !is COM.S_OK && retryCount++ < 10) { - try {Thread.sleep(0.050);} catch (Exception t) {} + try {Thread.sleep(50);} catch (Exception t) {} MSG msg; OS.PeekMessage(&msg, null, 0, 0, OS.PM_NOREMOVE | OS.PM_NOYIELD); result = COM.OleSetClipboard(iDataObject);
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Transfer.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/dnd/Transfer.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,14 +12,13 @@ *******************************************************************************/ module org.eclipse.swt.dnd.Transfer; - import org.eclipse.swt.internal.win32.OS; import org.eclipse.swt.internal.ole.win32.COM; import org.eclipse.swt.dnd.TransferData; import java.lang.all; +import java.lang.Thread; import org.eclipse.swt.internal.ole.win32.OBJIDL; -static import tango.core.Thread; /** * <code>Transfer</code> provides a mechanism for converting between a java @@ -49,13 +48,13 @@ */ int getData(IDataObject dataObject, FORMATETC* pFormatetc, STGMEDIUM* pmedium) { if (dataObject.GetData(pFormatetc, pmedium) is COM.S_OK) return COM.S_OK; - try {tango.core.Thread.Thread.sleep(0.050);} catch (Exception t) {} + try {tango.core.Thread.Thread.sleep(50);} catch (Exception t) {} int result = dataObject.GetData(pFormatetc, pmedium); int retryCount = 0; while (result !is COM.S_OK && retryCount++ < RETRY_LIMIT) { MSG msg; OS.PeekMessage(&msg, null, 0, 0, OS.PM_NOREMOVE | OS.PM_NOYIELD); - try {tango.core.Thread.Thread.sleep(0.050);} catch (Exception t) {} + try {tango.core.Thread.Thread.sleep(50);} catch (Exception t) {} result = dataObject.GetData(pFormatetc, pmedium); } return result;
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/Lock.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/Lock.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,7 +12,7 @@ *******************************************************************************/ module org.eclipse.swt.internal.Lock; -import tango.core.Thread; +import java.lang.Thread; import tango.core.sync.Mutex; import tango.core.sync.Condition; @@ -38,7 +38,7 @@ */ public int lock() { synchronized (mutex) { - Thread current = Thread.getThis(); + Thread current = Thread.currentThread(); if (owner !is current) { waitCount++; while (count > 0) { @@ -61,7 +61,7 @@ */ public void unlock() { synchronized (mutex) { - Thread current = Thread.getThis(); + Thread current = Thread.currentThread(); if (owner is current) { if (--count is 0) { owner = null;
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Display.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Display.d Wed Mar 18 10:55:25 2009 +0100 @@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.TrayItem; import java.lang.all; -import tango.core.Thread; +import java.lang.Thread; /** * Instances of this class are responsible for managing the @@ -739,7 +739,7 @@ override protected void checkDevice () { if (thread is null) error (SWT.ERROR_WIDGET_DISPOSED); - if (thread !is Thread.getThis ()) { + if (thread !is Thread.currentThread ()) { /* * Bug in IBM JVM 1.6. For some reason, under * conditions that are yet to be full understood, @@ -830,7 +830,7 @@ */ override protected void create (DeviceData data) { checkSubclass (); - checkDisplay (thread = Thread.getThis (), true); + checkDisplay (thread = Thread.currentThread (), true); createDisplay (data); register (this); if (Default is null) Default = this; @@ -1455,7 +1455,7 @@ */ public static Display getCurrent () { static_this(); - return findDisplay (Thread.getThis ()); + return findDisplay (Thread.currentThread ()); } int getClickCount (int type, int button, HWND hwnd, int lParam) { @@ -2713,7 +2713,7 @@ } bool isValidThread () { - return thread is Thread.getThis (); + return thread is Thread.currentThread (); } /** @@ -4543,7 +4543,7 @@ public void wake () { synchronized (Device.classinfo) { if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED); - if (thread is Thread.getThis ()) return; + if (thread is Thread.currentThread ()) return; wakeThread (); } } @@ -4635,7 +4635,7 @@ */ if (msg is OS.WM_NCHITTEST) { if (hitCount++ >= 1024) { - try {Thread.sleep (0.001);} catch (Exception t) {} + try {Thread.sleep (1);} catch (Exception t) {} } } else { hitCount = 0;
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/RunnableLock.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/RunnableLock.d Wed Mar 18 10:55:25 2009 +0100 @@ -12,8 +12,8 @@ *******************************************************************************/ module org.eclipse.swt.widgets.RunnableLock; -import tango.core.Thread; -import java.lang.Runnable; +import java.lang.all; +import java.lang.Thread; import tango.core.sync.Condition; import tango.core.sync.Mutex;
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Synchronizer.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Synchronizer.d Wed Mar 18 10:55:25 2009 +0100 @@ -14,14 +14,13 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.RunnableLock; -import java.lang.Runnable; -import java.lang.System; import org.eclipse.swt.internal.Compatibility; import org.eclipse.swt.SWT; -import tango.core.Thread; +import java.lang.all; +import java.lang.Thread; +import tango.core.Exception: SyncException; import org.eclipse.swt.graphics.Device; -import tango.core.Exception; /** * Instances of this class provide synchronization support @@ -179,7 +178,7 @@ /* * Only remember the syncThread for syncExec. */ - lock.thread = Thread.getThis(); + lock.thread = Thread.currentThread(); addLast (lock); } }
--- a/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Widget.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/Widget.d Wed Mar 18 10:55:25 2009 +0100 @@ -26,8 +26,8 @@ import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.TypedListener; -import tango.core.Thread; import java.lang.all; +import java.lang.Thread; /** * This class is the abstract superclass of all user interface objects. @@ -362,7 +362,7 @@ void checkWidget () { Display display = this.display; if (display is null) error (SWT.ERROR_WIDGET_DISPOSED); - if (display.thread !is Thread.getThis ()) { + if (display.thread !is Thread.currentThread ()) { /* * Bug in IBM JVM 1.6. For some reason, under * conditions that are yet to be full understood,
--- a/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.d Wed Mar 18 10:55:25 2009 +0100 @@ -75,7 +75,6 @@ import java.util.List; import java.util.LinkedList; import java.util.Set; -import tango.core.Exception; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.AbstractLineTracker;
--- a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.d Wed Mar 18 10:55:25 2009 +0100 @@ -30,8 +30,7 @@ import java.util.HashMap; import java.util.Set; import java.util.IdentityHashMap; -import tango.core.Exception; -import java.lang.JThread; +import java.lang.Thread; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.AbstractDocument; @@ -690,7 +689,7 @@ removeAnnotations(deleted, false, false); synchronized (getLockObject()) { if (fModelEvent !is null) - (new JThread ( &fireModelChanged )).start(); + (new Thread ( &fireModelChanged )).start(); } } else removeAnnotations(deleted, fireModelChanged_, false);
--- a/org.eclipse.ui.forms/src/org/eclipse/ui/forms/ManagedForm.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.ui.forms/src/org/eclipse/ui/forms/ManagedForm.d Wed Mar 18 10:55:25 2009 +0100 @@ -26,7 +26,7 @@ import java.lang.all; import java.util.Vector; import java.util.Set; -import tango.core.Thread; +import java.lang.Thread; /** * Managed form wraps a form widget and adds life cycle methods for form parts. @@ -200,7 +200,7 @@ * <code>asyncExec</code>. */ public void refresh() { - Thread t = Thread.getThis(); + Thread t = Thread.currentThread(); Thread dt = toolkit.getColors().getDisplay().getThread(); if (t.opEquals(dt)) doRefresh();
--- a/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.d Wed Mar 18 09:57:53 2009 +0100 +++ b/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/BusyIndicator.d Wed Mar 18 10:55:25 2009 +0100 @@ -35,13 +35,13 @@ import java.util.Set; import tango.util.Convert; -import java.lang.JThread; +import java.lang.Thread; public final class BusyIndicator : Canvas { alias Canvas.computeSize computeSize; - class BusyThread : JThread { + class BusyThread : Thread { Rectangle bounds; Display display; GC offScreenImageGC; @@ -125,7 +125,7 @@ * Sleep for the specified delay time */ try { - JThread.sleep(MILLISECONDS_OF_DELAY); + Thread.sleep(MILLISECONDS_OF_DELAY); } catch (InterruptedException e) { ExceptionPrintStackTrace(e); } @@ -221,7 +221,7 @@ Image offScreenImage = new Image(display, bounds.width, bounds.height); GC offScreenImageGC = new GC(offScreenImage); busyThread = new BusyThread(bounds, display, offScreenImageGC, offScreenImage); - busyThread.setPriority(JThread.NORM_PRIORITY + 2); + busyThread.setPriority(Thread.NORM_PRIORITY + 2); busyThread.setDaemon(true); busyThread.start(); }