I do have difficulties in understanding the behaviour of the setCurrent() method when switching forms.

Consider an application with two forms, form1 and form2, with form1 initially beeing shown, and the following lines of code:

myDisplay.setCurrent (form2);
... // doing some calculations
myDisplay.setCurrent (form1);

The code is executed by a separate thread. In most cases (but not always) form2 is visible afterwards. Since the calls to setCurrent() are simple messages posted to the thread doing the display stuff (the main thread?), this is weird. I could understand if form2 was never been shown, cause the time in-between the calls might be to short, but the last call should prevail over all preceding ones.

Since the effect is not always reproducable, I suspect a concurrency problem here. Can anyone explain this?