Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89770b4c authored by Dave Burke's avatar Dave Burke Committed by Android Git Automerger
Browse files

am 6f13adb2: Merge "Don\'t hold onto the lock while reconnecting to the server" into ics-mr0

* commit '6f13adb22afcb47a1cd45a90eaa3c154522089d4':
  Don't hold onto the lock while reconnecting to the server
parents 2bfdd428 a038c14e
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -279,6 +279,8 @@ void NuCachedSource2::onMessageReceived(const sp<AMessage> &msg) {
void NuCachedSource2::fetchInternal() {
    LOGV("fetchInternal");

    bool reconnect = false;

    {
        Mutex::Autolock autoLock(mLock);
        CHECK(mFinalStatus == OK || mNumRetriesLeft > 0);
@@ -286,9 +288,16 @@ void NuCachedSource2::fetchInternal() {
        if (mFinalStatus != OK) {
            --mNumRetriesLeft;

            reconnect = true;
        }
    }

    if (reconnect) {
        status_t err =
            mSource->reconnectAtOffset(mCacheOffset + mCache->totalSize());

        Mutex::Autolock autoLock(mLock);

        if (err == ERROR_UNSUPPORTED) {
            mNumRetriesLeft = 0;
            return;
@@ -299,7 +308,6 @@ void NuCachedSource2::fetchInternal() {
            return;
        }
    }
    }

    PageCache::Page *page = mCache->acquirePage();