summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-02-24 12:42:46 -0800
committerVasu Nori <vnori@google.com>2010-02-24 12:42:46 -0800
commit1d7265800d91c79346f03d635d5b417b3d4a7e31 (patch)
treeef525a56eaccd08537450d5415711f485a7bd2d7
parent8ca1228168d05533b4810be337bb400356b2379e (diff)
downloadframeworks_base-1d7265800d91c79346f03d635d5b417b3d4a7e31.zip
frameworks_base-1d7265800d91c79346f03d635d5b417b3d4a7e31.tar.gz
frameworks_base-1d7265800d91c79346f03d635d5b417b3d4a7e31.tar.bz2
yet another race condition fix to address bug:2456970
-rw-r--r--core/java/android/database/sqlite/SQLiteProgram.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/database/sqlite/SQLiteProgram.java b/core/java/android/database/sqlite/SQLiteProgram.java
index a3a8486..7a29cb4 100644
--- a/core/java/android/database/sqlite/SQLiteProgram.java
+++ b/core/java/android/database/sqlite/SQLiteProgram.java
@@ -57,8 +57,10 @@ public abstract class SQLiteProgram extends SQLiteClosable {
mCompiledSql = new SQLiteCompiledSql(db, sql);
// add it to the cache of compiled-sqls
- db.addToCompiledQueries(sql, mCompiledSql);
+ // but before adding it and thus making it available for anyone else to use it,
+ // make sure it is acquired by me.
mCompiledSql.acquire();
+ db.addToCompiledQueries(sql, mCompiledSql);
} else {
// it is already in compiled-sql cache.
// try to acquire the object.