diff options
| author | Vasu Nori <vnori@google.com> | 2010-02-24 12:42:46 -0800 |
|---|---|---|
| committer | Vasu Nori <vnori@google.com> | 2010-02-24 12:42:46 -0800 |
| commit | 1d7265800d91c79346f03d635d5b417b3d4a7e31 (patch) | |
| tree | ef525a56eaccd08537450d5415711f485a7bd2d7 | |
| parent | 8ca1228168d05533b4810be337bb400356b2379e (diff) | |
| download | frameworks_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.java | 4 |
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. |
