summaryrefslogtreecommitdiff
path: root/indra/llfilesystem
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-05-17 15:10:06 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-05-17 15:10:06 -0400
commitb3708ac238d51eaf808cb77a4493e518c1593e33 (patch)
tree8630531a439a759df0728c2b8e1d97bb79baa15d /indra/llfilesystem
parentd313d7021ff551f2a5ef7ec54ff2b3234d96017b (diff)
SL-15200: Use new LLApp::sleep() in LLPurgeDiskCacheThread::run().
Diffstat (limited to 'indra/llfilesystem')
-rw-r--r--indra/llfilesystem/lldiskcache.cpp16
-rw-r--r--indra/llfilesystem/lldiskcache.h3
2 files changed, 5 insertions, 14 deletions
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp
index c0f10ac620..6b0bbaeb48 100644
--- a/indra/llfilesystem/lldiskcache.cpp
+++ b/indra/llfilesystem/lldiskcache.cpp
@@ -31,6 +31,7 @@
*/
#include "linden_common.h"
+#include "llapp.h"
#include "llassettype.h"
#include "lldir.h"
#include <boost/filesystem.hpp>
@@ -371,17 +372,10 @@ LLPurgeDiskCacheThread::LLPurgeDiskCacheThread() :
void LLPurgeDiskCacheThread::run()
{
- constexpr F64 CHECK_INTERVAL = 60;
- mTimer.setTimerExpirySec(CHECK_INTERVAL);
- mTimer.start();
+ constexpr long CHECK_INTERVAL = 60;
- do
+ while (LLApp::instance()->sleep(std::chrono::seconds(CHECK_INTERVAL)))
{
- if (mTimer.checkExpirationAndReset(CHECK_INTERVAL))
- {
- LLDiskCache::instance().purge();
- }
-
- ms_sleep(100);
- } while (!isQuitting());
+ LLDiskCache::instance().purge();
+ }
}
diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h
index 268fe92bcc..1cbd2c58aa 100644
--- a/indra/llfilesystem/lldiskcache.h
+++ b/indra/llfilesystem/lldiskcache.h
@@ -194,8 +194,5 @@ public:
protected:
void run() override;
-
-private:
- LLTimer mTimer;
};
#endif // _LLDISKCACHE