Ignore:
Timestamp:
Jan 9, 2017, 11:09:38 AM (3 years ago)
Author:
jrpelegrina
Message:

Update new version: 3.15.02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • filezilla/trunk/fuentes/src/engine/directorycache.cpp

    r130 r3185  
    2727void CDirectoryCache::Store(const CDirectoryListing &listing, const CServer &server)
    2828{
    29         scoped_lock lock(mutex_);
     29        fz::scoped_lock lock(mutex_);
    3030
    3131        tServerIter sit = CreateServerEntry(server);
     
    3838        if (Lookup(cit, sit, listing.path, true, unused)) {
    3939                auto & entry = const_cast<CCacheEntry&>(*cit);
    40                 entry.modificationTime = CMonotonicClock::now();
     40                entry.modificationTime = fz::monotonic_clock::now();
    4141
    4242                m_totalFileCount -= cit->listing.GetCount();
     
    5555bool CDirectoryCache::Lookup(CDirectoryListing &listing, const CServer &server, const CServerPath &path, bool allowUnsureEntries, bool& is_outdated)
    5656{
    57         scoped_lock lock(mutex_);
     57        fz::scoped_lock lock(mutex_);
    5858
    5959        tServerIter sit = GetServerEntry(server);
     
    8585                                return false;
    8686
    87                         is_outdated = (CMonotonicClock::now() - entry.listing.m_firstListTime).get_seconds() > CACHE_TIMEOUT;
     87                        is_outdated = (fz::monotonic_clock::now() - entry.listing.m_firstListTime).get_seconds() > CACHE_TIMEOUT;
    8888                        return true;
    8989                }
     
    9595bool CDirectoryCache::DoesExist(const CServer &server, const CServerPath &path, int &hasUnsureEntries, bool &is_outdated)
    9696{
    97         scoped_lock lock(mutex_);
     97        fz::scoped_lock lock(mutex_);
    9898
    9999        tServerIter sit = GetServerEntry(server);
     
    112112bool CDirectoryCache::LookupFile(CDirentry &entry, const CServer &server, const CServerPath &path, const wxString& file, bool &dirDidExist, bool &matchedCase)
    113113{
    114         scoped_lock lock(mutex_);
     114        fz::scoped_lock lock(mutex_);
    115115
    116116        tServerIter sit = GetServerEntry(server);
     
    149149bool CDirectoryCache::InvalidateFile(const CServer &server, const CServerPath &path, const wxString& filename, bool *wasDir /*=false*/)
    150150{
    151         scoped_lock lock(mutex_);
     151        fz::scoped_lock lock(mutex_);
    152152
    153153        tServerIter sit = GetServerEntry(server);
     
    170170                }
    171171                entry.listing.m_flags |= CDirectoryListing::unsure_unknown;
    172                 entry.modificationTime = CMonotonicClock::now();
     172                entry.modificationTime = fz::monotonic_clock::now();
    173173        }
    174174
     
    178178bool CDirectoryCache::UpdateFile(const CServer &server, const CServerPath &path, const wxString& filename, bool mayCreate, enum Filetype type /*=file*/, int64_t size /*=-1*/)
    179179{
    180         scoped_lock lock(mutex_);
     180        fz::scoped_lock lock(mutex_);
    181181
    182182        tServerIter sit = GetServerEntry(server);
     
    240240                else
    241241                        entry.listing.m_flags |= CDirectoryListing::unsure_unknown;
    242                 entry.modificationTime = CMonotonicClock::now();
     242                entry.modificationTime = fz::monotonic_clock::now();
    243243
    244244                updated = true;
     
    250250bool CDirectoryCache::RemoveFile(const CServer &server, const CServerPath &path, const wxString& filename)
    251251{
    252         scoped_lock lock(mutex_);
     252        fz::scoped_lock lock(mutex_);
    253253
    254254        tServerIter sit = GetServerEntry(server);
     
    286286                        entry.listing.m_flags |= CDirectoryListing::unsure_invalid;
    287287                }
    288                 entry.modificationTime = CMonotonicClock::now();
     288                entry.modificationTime = fz::monotonic_clock::now();
    289289        }
    290290
     
    294294void CDirectoryCache::InvalidateServer(const CServer& server)
    295295{
    296         scoped_lock lock(mutex_);
     296        fz::scoped_lock lock(mutex_);
    297297
    298298        for (auto iter = m_serverList.begin(); iter != m_serverList.end(); ++iter)
     
    318318}
    319319
    320 bool CDirectoryCache::GetChangeTime(CMonotonicClock& time, const CServer &server, const CServerPath &path)
    321 {
    322         scoped_lock lock(mutex_);
     320bool CDirectoryCache::GetChangeTime(fz::monotonic_clock& time, const CServer &server, const CServerPath &path)
     321{
     322        fz::scoped_lock lock(mutex_);
    323323
    324324        tServerIter sit = GetServerEntry(server);
     
    338338void CDirectoryCache::RemoveDir(const CServer& server, const CServerPath& path, const wxString& filename, const CServerPath&)
    339339{
    340         scoped_lock lock(mutex_);
     340        fz::scoped_lock lock(mutex_);
    341341
    342342        // TODO: This is not 100% foolproof and may not work properly
     
    373373void CDirectoryCache::Rename(const CServer& server, const CServerPath& pathFrom, const wxString& fileFrom, const CServerPath& pathTo, const wxString& fileTo)
    374374{
    375         scoped_lock lock(mutex_);
     375        fz::scoped_lock lock(mutex_);
    376376
    377377        tServerIter sit = GetServerEntry(server);
Note: See TracChangeset for help on using the changeset viewer.