Merge "Reorder lock acquision vs try."

This commit is contained in:
Jean-Baptiste Queru
2010-11-17 17:03:10 -08:00
committed by Android Code Review

View File

@ -131,11 +131,11 @@ public class SQLiteCursor extends AbstractWindowedCursor {
// the cursor's state doesn't change // the cursor's state doesn't change
while (true) { while (true) {
mLock.lock(); mLock.lock();
if (mCursorState != mThreadState) {
mLock.unlock();
break;
}
try { try {
if (mCursorState != mThreadState) {
break;
}
int count = mQuery.fillWindow(cw, mMaxRead, mCount); int count = mQuery.fillWindow(cw, mMaxRead, mCount);
// return -1 means not finished // return -1 means not finished
if (count != 0) { if (count != 0) {
@ -217,9 +217,8 @@ public class SQLiteCursor extends AbstractWindowedCursor {
mColumnNameMap = null; mColumnNameMap = null;
mQuery = query; mQuery = query;
db.lock();
try { try {
db.lock();
// Setup the list of columns // Setup the list of columns
int columnCount = mQuery.columnCountLocked(); int columnCount = mQuery.columnCountLocked();
mColumns = new String[columnCount]; mColumns = new String[columnCount];