Loading libs/androidfw/AssetManager.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -1837,6 +1837,7 @@ ZipFileRO* AssetManager::SharedZip::getZip() Asset* AssetManager::SharedZip::getResourceTableAsset() Asset* AssetManager::SharedZip::getResourceTableAsset() { { AutoMutex _l(gLock); ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); return mResourceTableAsset; return mResourceTableAsset; } } Loading @@ -1846,10 +1847,10 @@ Asset* AssetManager::SharedZip::setResourceTableAsset(Asset* asset) { { AutoMutex _l(gLock); AutoMutex _l(gLock); if (mResourceTableAsset == NULL) { if (mResourceTableAsset == NULL) { mResourceTableAsset = asset; // This is not thread safe the first time it is called, so // This is not thread safe the first time it is called, so // do it here with the global lock held. // do it here with the global lock held. asset->getBuffer(true); asset->getBuffer(true); mResourceTableAsset = asset; return asset; return asset; } } } } Loading Loading
libs/androidfw/AssetManager.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -1837,6 +1837,7 @@ ZipFileRO* AssetManager::SharedZip::getZip() Asset* AssetManager::SharedZip::getResourceTableAsset() Asset* AssetManager::SharedZip::getResourceTableAsset() { { AutoMutex _l(gLock); ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); ALOGV("Getting from SharedZip %p resource asset %p\n", this, mResourceTableAsset); return mResourceTableAsset; return mResourceTableAsset; } } Loading @@ -1846,10 +1847,10 @@ Asset* AssetManager::SharedZip::setResourceTableAsset(Asset* asset) { { AutoMutex _l(gLock); AutoMutex _l(gLock); if (mResourceTableAsset == NULL) { if (mResourceTableAsset == NULL) { mResourceTableAsset = asset; // This is not thread safe the first time it is called, so // This is not thread safe the first time it is called, so // do it here with the global lock held. // do it here with the global lock held. asset->getBuffer(true); asset->getBuffer(true); mResourceTableAsset = asset; return asset; return asset; } } } } Loading