Mercurial > projects > dwt-addons
diff dwtx/jface/text/reconciler/AbstractReconciler.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 25f1f92fa3df |
children | 862b05e0334a |
line wrap: on
line diff
--- a/dwtx/jface/text/reconciler/AbstractReconciler.d Wed Aug 27 14:49:30 2008 +0200 +++ b/dwtx/jface/text/reconciler/AbstractReconciler.d Mon Sep 08 00:51:37 2008 +0200 @@ -89,14 +89,19 @@ public this(String name) { thread = new Thread( &run ); thread.name = name; - thread.priority = Thread.MIN_PRIORITY; + thread.priority = Thread.PRIORITY_MIN; thread.isDaemon(true); } public void start(){ thread.start(); } - + public bool isAlive(){ + return thread.isRunning(); + } + public Thread getThread(){ + return thread; + } /** * Returns whether a reconciling strategy is active right now. * @@ -260,7 +265,7 @@ public void documentChanged(DocumentEvent e) { if (!fThread.isDirty() && fThread.isAlive()) { - if (!fIsAllowedToModifyDocument && Thread.currentThread() is fThread) + if (!fIsAllowedToModifyDocument && Thread.getThis() is fThread.getThread()) throw new UnsupportedOperationException("The reconciler thread is not allowed to modify the document"); //$NON-NLS-1$ aboutToBeReconciled(); } @@ -474,13 +479,13 @@ */ public void install(ITextViewer textViewer) { - Assert.isNotNull(textViewer); + Assert.isNotNull(cast(Object)textViewer); fViewer= textViewer; synchronized (this) { if (fThread !is null) return; - fThread= new BackgroundThread(getClass().getName()); + fThread= new BackgroundThread(this.classinfo.name); } fDirtyRegionQueue= new DirtyRegionQueue(); @@ -597,14 +602,15 @@ return; if (!fThread.isAlive()) { - try { +// DWT +// try { fThread.start(); - } catch (IllegalThreadStateException e) { +// } catch (IllegalThreadStateException e) { // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=40549 // This is the only instance where the thread is started; since // we checked that it is not alive, it must be dead already due // to a run-time exception or error. Exit. - } +// } } else { fThread.reset(); } @@ -624,6 +630,6 @@ * @since 3.4 */ protected bool isRunningInReconcilerThread() { - return Thread.currentThread() is fThread; + return Thread.getThis() is fThread.getThread(); } }