Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327906 - Display#wake does not work reliably during lifecycle
Summary: Display#wake does not work reliably during lifecycle
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr132
Keywords:
: 317908 (view as bug list)
Depends on:
Blocks: 315418
  Show dependency tree
 
Reported: 2010-10-15 11:24 EDT by Ralf Sternberg CLA
Modified: 2010-10-26 06:58 EDT (History)
1 user (show)

See Also:


Attachments
Test case (1.76 KB, patch)
2010-10-15 11:33 EDT, Ralf Sternberg CLA
no flags Details | Diff
Patch for 1.3 and HEAD (854 bytes, patch)
2010-10-18 07:08 EDT, Ralf Sternberg CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2010-10-15 11:24:53 EDT
When Display#wake is called from a background thread while the UIThread is currently running, it will have no effect, even though the UICallBack is active.
This is caused by the implementation of UICallBackManager#sendUICallBack, which does nothing when the UIThread is running. The idea behind this implementation is that when the UIThread finishes ( in notifyUIThreadEnd ), the UICallBack request is answered if the Synchronizer has asyncRunnables in the queue. But in case of wake, there are no runnables.

JFace uses Display#wake in ModalContext ( indirectly called through asyncExec( null ) ), where this bug prevents the ModalContext from finishing correctly (which in turn causes bug 315418).
Comment 1 Ralf Sternberg CLA 2010-10-15 11:33:08 EDT
Created attachment 180973 [details]
Test case
Comment 2 Ralf Sternberg CLA 2010-10-18 07:08:33 EDT
Created attachment 181081 [details]
Patch for 1.3 and HEAD

With this patch, Display#wake causes the UICallBack request to unblock immediately. This should solve the problem reliably, but could still be optimized for cases where Display#wake is called multiple times in one request.
Comment 3 Ralf Sternberg CLA 2010-10-18 07:15:59 EDT
Applied patch to CVS HEAD. We should consider applying it to 1.3 maintenance branch as well.
Comment 4 Ralf Sternberg CLA 2010-10-18 10:38:43 EDT
*** Bug 317908 has been marked as a duplicate of this bug. ***
Comment 5 Ralf Sternberg CLA 2010-10-26 06:58:12 EDT
Applied the patch also to the 1.3 maintenance branch.