am cfbb7fbd: Fix: Read lock is wrongly used for gutSuggestions.
* commit 'cfbb7fbd48125909ed61e58500e56b06afc12709': Fix: Read lock is wrongly used for gutSuggestions.main
commit
551091ef39
|
@ -196,7 +196,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
|||
final String prevWord, final ProximityInfo proximityInfo,
|
||||
final boolean blockOffensiveWords) {
|
||||
asyncReloadDictionaryIfRequired();
|
||||
if (mLocalDictionaryController.readLock().tryLock()) {
|
||||
// Write lock because getSuggestions in native updates session status.
|
||||
if (mLocalDictionaryController.writeLock().tryLock()) {
|
||||
try {
|
||||
final ArrayList<SuggestedWordInfo> inMemDictSuggestion =
|
||||
mDictionaryWriter.getSuggestions(composer, prevWord, proximityInfo,
|
||||
|
@ -217,7 +218,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
|
|||
return inMemDictSuggestion;
|
||||
}
|
||||
} finally {
|
||||
mLocalDictionaryController.readLock().unlock();
|
||||
mLocalDictionaryController.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue