mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Remove redundant sleep in RamCachingFileLoader
This commit is contained in:
parent
130bd7bbb6
commit
d426ccf178
2 changed files with 4 additions and 5 deletions
|
@ -104,12 +104,11 @@ void RamCachingFileLoader::ShutdownCache() {
|
||||||
|
|
||||||
// We can't delete while the thread is running, so have to wait.
|
// We can't delete while the thread is running, so have to wait.
|
||||||
// This should only happen from the menu.
|
// This should only happen from the menu.
|
||||||
while (aheadThreadRunning_) {
|
|
||||||
sleep_ms(1, "shutdown-ram-cache-poll");
|
|
||||||
}
|
|
||||||
if (aheadThread_.joinable())
|
if (aheadThread_.joinable())
|
||||||
aheadThread_.join();
|
aheadThread_.join();
|
||||||
|
|
||||||
|
_dbg_assert_(!aheadThreadRunning_);
|
||||||
|
|
||||||
std::lock_guard<std::mutex> guard(blocksMutex_);
|
std::lock_guard<std::mutex> guard(blocksMutex_);
|
||||||
blocks_.clear();
|
blocks_.clear();
|
||||||
if (cache_ != nullptr) {
|
if (cache_ != nullptr) {
|
||||||
|
|
|
@ -64,8 +64,8 @@ private:
|
||||||
|
|
||||||
std::vector<u8> blocks_;
|
std::vector<u8> blocks_;
|
||||||
std::mutex blocksMutex_;
|
std::mutex blocksMutex_;
|
||||||
u32 aheadRemaining_;
|
u32 aheadRemaining_ = 0;
|
||||||
s64 aheadPos_;
|
s64 aheadPos_ = 0;
|
||||||
std::thread aheadThread_;
|
std::thread aheadThread_;
|
||||||
bool aheadThreadRunning_ = false;
|
bool aheadThreadRunning_ = false;
|
||||||
bool aheadCancel_ = false;
|
bool aheadCancel_ = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue