Use std::mutex
This commit is contained in:
parent
67af16f0e2
commit
f4b6323050
2 changed files with 3 additions and 3 deletions
|
|
@ -476,7 +476,7 @@ void sfz::FilePool::dispatchingJob() noexcept
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<SpinMutex> guard { loadingJobsMutex };
|
std::lock_guard<std::mutex> guard { loadingJobsMutex };
|
||||||
|
|
||||||
if (filesToLoad.try_pop(queuedData)) {
|
if (filesToLoad.try_pop(queuedData)) {
|
||||||
loadingJobs.push_back(
|
loadingJobs.push_back(
|
||||||
|
|
@ -517,7 +517,7 @@ void sfz::FilePool::emptyFileLoadingQueues() noexcept
|
||||||
|
|
||||||
void sfz::FilePool::waitForBackgroundLoading() noexcept
|
void sfz::FilePool::waitForBackgroundLoading() noexcept
|
||||||
{
|
{
|
||||||
std::lock_guard<SpinMutex> guard { loadingJobsMutex };
|
std::lock_guard<std::mutex> guard { loadingJobsMutex };
|
||||||
|
|
||||||
for (auto& job : loadingJobs)
|
for (auto& job : loadingJobs)
|
||||||
job.wait();
|
job.wait();
|
||||||
|
|
|
||||||
|
|
@ -354,7 +354,7 @@ private:
|
||||||
void dispatchingJob() noexcept;
|
void dispatchingJob() noexcept;
|
||||||
void garbageJob() noexcept;
|
void garbageJob() noexcept;
|
||||||
void loadingJob(QueuedFileData data) noexcept;
|
void loadingJob(QueuedFileData data) noexcept;
|
||||||
SpinMutex loadingJobsMutex;
|
std::mutex loadingJobsMutex;
|
||||||
std::vector<std::future<void>> loadingJobs;
|
std::vector<std::future<void>> loadingJobs;
|
||||||
std::thread dispatchThread { &FilePool::dispatchingJob, this };
|
std::thread dispatchThread { &FilePool::dispatchingJob, this };
|
||||||
std::thread garbageThread { &FilePool::garbageJob, this };
|
std::thread garbageThread { &FilePool::garbageJob, this };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue