<AWT Dev> Review request for CR 8006634 Unify LWCToolkit.invokeAndWait() and CToolkitThreadBlockedHandler

Petr Pchelko petr.pchelko at oracle.com
Wed Feb 13 22:58:51 PST 2013

Hello, AWT Team. 

Please review the fix for the issue:
The fix is available at:

This fix makes a lot of changes in nested event loops:

1. CToolkitThreadBlockedHandler was made a subclass of Mutex as it is made on other platforms. Shared code relies on that with logic for entering/exiting nested event loops. Previously it did not matter as CToolkitThreadBlockedHandler did not make a actual nested loop. Now it makes a native nested loop via doAWTRunLoop. 

2. doAWTRunLoop method is changed
	a. Now we have a boolean flag processEvents. If it is set to false, we do not process native events while in the nested loop, same as how it was done before the fix. If it is set to true, events are processed while in the loop. Attention is needed when using this new feature, because we short-circuit native event processing and there could be some cases when it breaks Appkit. (resizing windows with a mouse could be an example) However we need this feature in the Drag and Drop.
	b. I have got rid of an feature to run the nested loop in NSDefaultRunLoopMode, it was never used. 

3. We decided that we are getting rid of the deadlock detection mechanism: it is rarely used, nobody have ever seen the error message from it. I have tested a lot without this feature and it looks like everything is fine, however I am absolutely not sure about this decision. I am including Peter and Ragini as Accessibility was using this functionality and I had to change Accessibility code a bit.

4. Some native methods from the LWCToolkit were made package-private. The comment stated that deploy used them, but I've cloned there code and they apparently do not use it any more. Looks like the comment is from Apple times and we do not event have a WebkitPluginObject any more.

With best regards. Petr.

More information about the awt-dev mailing list