Fix UI freeze by ImeUtil::ActivateForCurrentSessio
Looks like the TSF needs to rebuild a certain cache after changing the
input details. Perhaps this rebuiding process is not resilient enough
for a relatively lot of threads. The freezing window threads are
waiting for MSCTF.AsmCacheReady.<desktop name><session #> event and
later waiting for an IMM critical section that the former threads own.
This continues for about a minute.
If we wait for the cache ready
(MSCTF.AsmCacheReady.<desktopname><session #> event signal which usually
takes a few hundreds msecs) before broadcasting the input langauge
change, the change seems to be applied flawlessly.
BUG=none
TEST=maunally done
REF_BUG=5765783
REF_CL=84600315
Yohei Yukawa
8 years ago
0 | 0 |
MAJOR=2
|
1 | 1 |
MINOR=17
|
2 | |
BUILD=2113
|
|
2 |
BUILD=2114
|
3 | 3 |
REVISION=102
|
4 | 4 |
# NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
|
5 | 5 |
# downloaded by NaCl Mozc.
|
78 | 78 |
// http://msdn.microsoft.com/en-us/library/ms724872(VS.85).aspx
|
79 | 79 |
const DWORD kMaxValueNameLength = 16383;
|
80 | 80 |
|
|
81 |
// Timeout value used by a work around against b/5765783.
|
|
82 |
// Note that the following timeout threshold is not well tested.
|
|
83 |
// TODO(yukawa): Investigate the best timeout threshold. b/6165722
|
|
84 |
const uint32 kWaitForAsmCacheReadyEventTimeout = 10000; // 10 sec.
|
81 | 85 |
|
82 | 86 |
// Converts an unsigned integer to a wide string.
|
83 | 87 |
wstring utow(unsigned int i) {
|
|
351 | 355 |
return false;
|
352 | 356 |
}
|
353 | 357 |
|
|
358 |
// A work around against b/5765783.
|
|
359 |
if (!ImeUtil::WaitForAsmCacheReady(kWaitForAsmCacheReadyEventTimeout)) {
|
|
360 |
DLOG(ERROR) << "ImeUtil::WaitForAsmCacheReady failed.";
|
|
361 |
}
|
354 | 362 |
|
355 | 363 |
// Broadcasting WM_INPUTLANGCHANGEREQUEST so that existing process in the
|
356 | 364 |
// current session will change their input method to |hkl|. This mechanism
|