Fix ibus-daemon deadlock in engineproxy.c.
authorphuang <shawn.p.huang@gmail.com>
Wed, 9 Feb 2011 12:02:44 +0000 (21:02 +0900)
committerYusuke Sato <yusukes@chromium.org>
Wed, 9 Feb 2011 12:02:44 +0000 (21:02 +0900)
commit377c06515e792c2da4f4cf342ba5faa26eac5170
tree78cf9d6d511570e1c034d35ba1e608d9636b9873
parent0501756a1e51469849eca064aeb1e340afbf8be2
Fix ibus-daemon deadlock in engineproxy.c.

How to reproduce the deadlock on a desktop Linux like Ubuntu Maverick:

1. Add 20 seconds sleep in the beginning of the main() function of an engine (e.g. ibus-engine-mozc). See http://crosbug.com/11379#c16 .
2. Set preload_engines to "mozc" using ibus-setup.
3. Start ibus-daemon.
4. press the trigger hotkey twice within the 20 seconds.

Expected:
The second trigger hotkey press cancels the bus_engine_proxy_new operation started by the first one.

Actual:
ibus-daemon freezes. Stack trace: http://crosbug.com/11379#c20

BUG=http://crosbug.com/11379
TEST=see the steps above.

Review URL: http://codereview.appspot.com/4125053
Patch from phuang <shawn.p.huang@gmail.com>.
bus/engineproxy.c
bus/inputcontext.c