Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327906

Summary: Display#wake does not work reliably during lifecycle
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: phil.xue
Version: 1.3   
Target Milestone: 1.4 M3   
Hardware: All   
OS: All   
Whiteboard: sr132
Bug Depends on:    
Bug Blocks: 315418    
Attachments:
Description Flags
Test case
none
Patch for 1.3 and HEAD none

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.