aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-14 15:11:53 +0900
committerJean Chalard <jchalard@google.com>2012-08-14 17:04:14 +0900
commite30c05800fa463ef622132b0df466f5455281fc1 (patch)
tree83fe94ea086664d9c93e45417a86d0030ed1f324 /java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
parent5d6b8e181811e10b38dd30f4ba33757bb2162552 (diff)
downloadlatinime-e30c05800fa463ef622132b0df466f5455281fc1.tar.gz
latinime-e30c05800fa463ef622132b0df466f5455281fc1.tar.xz
latinime-e30c05800fa463ef622132b0df466f5455281fc1.zip
Preemptive anti-deadlock device
We don't know of any actual bug in the implementation of the pool that may result in a deadlock, but this still implements a means out of a deadlock if one ever arises anyway. It's meant to improve the resilience of the spell checker. Bug: 5441027 Change-Id: I689491090792dbb89110ee56631965c5bb2dc712
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
index 0171dc06d..06f5db749 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
@@ -193,7 +193,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
if (shouldFilterOut(inText, mScript)) {
DictAndProximity dictInfo = null;
try {
- dictInfo = mDictionaryPool.takeOrGetNull();
+ dictInfo = mDictionaryPool.pollWithDefaultTimeout();
if (null == dictInfo) {
return AndroidSpellCheckerService.getNotInDictEmptySuggestions();
}
@@ -236,7 +236,7 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session {
boolean isInDict = true;
DictAndProximity dictInfo = null;
try {
- dictInfo = mDictionaryPool.takeOrGetNull();
+ dictInfo = mDictionaryPool.pollWithDefaultTimeout();
if (null == dictInfo) {
return AndroidSpellCheckerService.getNotInDictEmptySuggestions();
}