diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IcePatch/IcePatchI.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cpp/src/IcePatch/IcePatchI.cpp b/cpp/src/IcePatch/IcePatchI.cpp index a2ee2e949ba..126ffd0d72e 100644 --- a/cpp/src/IcePatch/IcePatchI.cpp +++ b/cpp/src/IcePatch/IcePatchI.cpp @@ -45,7 +45,7 @@ IcePatch::DirectoryI::getContents(const Ice::Current& current) StringSeq filteredPaths; { - IceUtil::RWRecMutex::WLock sync(_globalMutex); // TODO: RLock as soon as lock promotion works. + IceUtil::RWRecMutex::RLock sync(_globalMutex); string path = identityToPath(current.identity); StringSeq paths = readDirectory(path); filteredPaths.reserve(paths.size() / 3); @@ -57,7 +57,7 @@ IcePatch::DirectoryI::getContents(const Ice::Current& current) equal_range(paths.begin(), paths.end(), removeSuffix(*p)); if (r.first == r.second) { - //IceUtil::RWRecMutex::WLock sync(_globalMutex); + sync.upgrade(); StringSeq paths2 = readDirectory(path); pair<StringSeq::const_iterator, StringSeq::const_iterator> r2 = equal_range(paths2.begin(), paths2.end(), removeSuffix(*p)); @@ -112,14 +112,14 @@ IcePatch::RegularI::RegularI(const ObjectAdapterPtr& adapter) : FileDescPtr IcePatch::RegularI::describe(const Ice::Current& current) { - IceUtil::RWRecMutex::WLock sync(_globalMutex); // TODO: RLock as soon as lock promotion works. + IceUtil::RWRecMutex::RLock sync(_globalMutex); string path = identityToPath(current.identity); FileInfo info = getFileInfo(path, true); FileInfo infoMD5 = getFileInfo(path + ".md5", false); if (infoMD5.type != FileTypeRegular || infoMD5.time < info.time) { - //IceUtil::RWRecMutex::WLock sync(_globalMutex); + sync.upgrade(); infoMD5 = getFileInfo(path + ".md5", false); if (infoMD5.type != FileTypeRegular || infoMD5.time < info.time) { @@ -142,14 +142,14 @@ IcePatch::RegularI::describe(const Ice::Current& current) Int IcePatch::RegularI::getBZ2Size(const Ice::Current& current) { - IceUtil::RWRecMutex::WLock sync(_globalMutex); // TODO: RLock as soon as lock promotion works. + IceUtil::RWRecMutex::RLock sync(_globalMutex); string path = identityToPath(current.identity); FileInfo info = getFileInfo(path, true); FileInfo infoBZ2 = getFileInfo(path + ".bz2", false); if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) { - //IceUtil::RWRecMutex::WLock sync(_globalMutex); + sync.upgrade(); infoBZ2 = getFileInfo(path + ".bz2", false); if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) { @@ -174,14 +174,14 @@ IcePatch::RegularI::getBZ2Size(const Ice::Current& current) ByteSeq IcePatch::RegularI::getBZ2(Ice::Int pos, Ice::Int num, const Ice::Current& current) { - IceUtil::RWRecMutex::WLock sync(_globalMutex); // TODO: RLock as soon as lock promotion works. + IceUtil::RWRecMutex::RLock sync(_globalMutex); string path = identityToPath(current.identity); FileInfo info = getFileInfo(path, true); FileInfo infoBZ2 = getFileInfo(path + ".bz2", false); if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) { - //IceUtil::RWRecMutex::WLock sync(_globalMutex); + sync.upgrade(); infoBZ2 = getFileInfo(path + ".bz2", false); if (infoBZ2.type != FileTypeRegular || infoBZ2.time < info.time) { |