mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 21:15:23 +02:00
[fix] Test for display being not disposed in RSEWaitAndDispatchUtil.waitAndDispatch
This commit is contained in:
parent
ee8f64552c
commit
74e348e11e
2 changed files with 3 additions and 2 deletions
|
@ -51,12 +51,12 @@ public final class RSEWaitAndDispatchUtil {
|
||||||
assert timeout > 0;
|
assert timeout > 0;
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
Display display = Display.findDisplay(Thread.currentThread());
|
final Display display = Display.findDisplay(Thread.currentThread());
|
||||||
if (display != null) {
|
if (display != null) {
|
||||||
// ok, we are running within a display thread --> keep the
|
// ok, we are running within a display thread --> keep the
|
||||||
// display event dispatching running.
|
// display event dispatching running.
|
||||||
long current = System.currentTimeMillis();
|
long current = System.currentTimeMillis();
|
||||||
while ((current - start) < timeout) {
|
while ((current - start) < timeout && !display.isDisposed()) {
|
||||||
if (!display.readAndDispatch()) display.sleep();
|
if (!display.readAndDispatch()) display.sleep();
|
||||||
current = System.currentTimeMillis();
|
current = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,6 +203,7 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
|
||||||
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
|
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
assertNull(e.getMessage(), e);
|
assertNull(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue