Mercurial > projects > dwt-addons
comparison dwtx/jface/text/reconciler/DirtyRegionQueue.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | f70d9508c95c |
children |
comparison
equal
deleted
inserted
replaced
161:f8d52b926852 | 162:1a5b8f8129df |
---|---|
28 | 28 |
29 import dwt.dwthelper.utils; | 29 import dwt.dwthelper.utils; |
30 | 30 |
31 import dwtx.dwtxhelper.Collection; | 31 import dwtx.dwtxhelper.Collection; |
32 | 32 |
33 | 33 import tango.core.sync.Mutex; |
34 import tango.core.sync.Condition; | |
34 | 35 |
35 /** | 36 /** |
36 * Queue used by {@link dwtx.jface.text.reconciler.AbstractReconciler} to manage | 37 * Queue used by {@link dwtx.jface.text.reconciler.AbstractReconciler} to manage |
37 * dirty regions. When a dirty region is inserted into the queue, the queue tries | 38 * dirty regions. When a dirty region is inserted into the queue, the queue tries |
38 * to fold it into the neighboring dirty region. | 39 * to fold it into the neighboring dirty region. |
39 * | 40 * |
40 * @see dwtx.jface.text.reconciler.AbstractReconciler | 41 * @see dwtx.jface.text.reconciler.AbstractReconciler |
41 * @see dwtx.jface.text.reconciler.DirtyRegion | 42 * @see dwtx.jface.text.reconciler.DirtyRegion |
42 */ | 43 */ |
43 class DirtyRegionQueue { | 44 class DirtyRegionQueue : Mutex { |
44 | 45 |
45 /** The list of dirty regions. */ | 46 /** The list of dirty regions. */ |
46 private List fDirtyRegions= new ArrayList(); | 47 private List fDirtyRegions; |
47 | 48 private Condition cond; |
48 /** | 49 /** |
49 * Creates a new empty dirty region. | 50 * Creates a new empty dirty region. |
50 */ | 51 */ |
51 public this() { | 52 public this() { |
52 super(); | 53 //super(); |
54 fDirtyRegions= new ArrayList(); | |
55 cond = new Condition(this); | |
56 } | |
57 | |
58 public void wait(){ | |
59 cond.wait(); | |
60 } | |
61 public void wait(int delay){ | |
62 cond.wait(delay/1000.0); | |
63 } | |
64 public void notifyAll(){ | |
65 cond.notifyAll(); | |
53 } | 66 } |
54 | 67 |
55 /** | 68 /** |
56 * Adds a dirty region to the end of the dirty-region queue. | 69 * Adds a dirty region to the end of the dirty-region queue. |
57 * | 70 * |