Loading core/java/android/database/sqlite/SQLiteCompiledSql.java +9 −5 Original line number Diff line number Diff line Loading @@ -95,12 +95,16 @@ import android.util.Log; } } /* package */ synchronized boolean isInUse() { return mInUse; /** * returns true if acquire() succeeds. false otherwise. */ /* package */ synchronized boolean acquire() { if (mInUse) { // someone already has acquired it. return false; } /* package */ synchronized void acquire() { mInUse = true; return true; } /* package */ synchronized void release() { Loading core/java/android/database/sqlite/SQLiteProgram.java +3 −6 Original line number Diff line number Diff line Loading @@ -61,16 +61,13 @@ public abstract class SQLiteProgram extends SQLiteClosable { mCompiledSql.acquire(); } else { // it is already in compiled-sql cache. if (mCompiledSql.isInUse()) { // but the CompiledSql in cache is in use by some other SQLiteProgram object. // try to acquire the object. if (!mCompiledSql.acquire()) { // the SQLiteCompiledSql in cache is in use by some other SQLiteProgram object. // we can't have two different SQLiteProgam objects can't share the same // CompiledSql object. create a new one. // finalize it when I am done with it in "this" object. mCompiledSql = new SQLiteCompiledSql(db, sql); } else { // the CompiledSql in cache is NOT in use by any other SQLiteProgram object. // it is safe to give it to this SQLIteProgram Object. mCompiledSql.acquire(); } } nStatement = mCompiledSql.nStatement; Loading Loading
core/java/android/database/sqlite/SQLiteCompiledSql.java +9 −5 Original line number Diff line number Diff line Loading @@ -95,12 +95,16 @@ import android.util.Log; } } /* package */ synchronized boolean isInUse() { return mInUse; /** * returns true if acquire() succeeds. false otherwise. */ /* package */ synchronized boolean acquire() { if (mInUse) { // someone already has acquired it. return false; } /* package */ synchronized void acquire() { mInUse = true; return true; } /* package */ synchronized void release() { Loading
core/java/android/database/sqlite/SQLiteProgram.java +3 −6 Original line number Diff line number Diff line Loading @@ -61,16 +61,13 @@ public abstract class SQLiteProgram extends SQLiteClosable { mCompiledSql.acquire(); } else { // it is already in compiled-sql cache. if (mCompiledSql.isInUse()) { // but the CompiledSql in cache is in use by some other SQLiteProgram object. // try to acquire the object. if (!mCompiledSql.acquire()) { // the SQLiteCompiledSql in cache is in use by some other SQLiteProgram object. // we can't have two different SQLiteProgam objects can't share the same // CompiledSql object. create a new one. // finalize it when I am done with it in "this" object. mCompiledSql = new SQLiteCompiledSql(db, sql); } else { // the CompiledSql in cache is NOT in use by any other SQLiteProgram object. // it is safe to give it to this SQLIteProgram Object. mCompiledSql.acquire(); } } nStatement = mCompiledSql.nStatement; Loading