Remove noexcept with RTSemaphores in

This commit is contained in:
Paul Fd 2020-04-07 22:42:27 +02:00 committed by Jean Pierre Cimalando
parent becdff5969
commit 758da22bd7
2 changed files with 11 additions and 7 deletions

View file

@ -108,7 +108,11 @@ sfz::FilePool::~FilePool()
quitThread = true;
for (unsigned i = 0; i < threadPool.size(); ++i)
workerBarrier.post();
try {
workerBarrier.post();
} catch (std::exception e) {
continue;
}
for (auto& thread: threadPool)
thread.join();
@ -261,7 +265,7 @@ absl::optional<sfz::FileDataHandle> sfz::FilePool::loadFile(const std::string& f
}
}
sfz::FilePromisePtr sfz::FilePool::getFilePromise(const std::string& filename) noexcept
sfz::FilePromisePtr sfz::FilePool::getFilePromise(const std::string& filename)
{
if (emptyPromises.empty()) {
DBG("[sfizz] No empty promises left to honor the one for " << filename);
@ -322,7 +326,7 @@ void sfz::FilePool::clearingThread()
}
}
void sfz::FilePool::loadingThread() noexcept
void sfz::FilePool::loadingThread()
{
FilePromisePtr promise;
while (!quitThread) {
@ -443,7 +447,7 @@ uint32_t sfz::FilePool::getPreloadSize() const noexcept
return preloadSize;
}
void sfz::FilePool::emptyFileLoadingQueues() noexcept
void sfz::FilePool::emptyFileLoadingQueues()
{
emptyQueue = true;
workerBarrier.post();

View file

@ -207,7 +207,7 @@ public:
* @param filename the file to preload
* @return FilePromisePtr a file promise
*/
FilePromisePtr getFilePromise(const std::string& filename) noexcept;
FilePromisePtr getFilePromise(const std::string& filename);
/**
* @brief Change the preloading size. This will trigger a full
* reload of all samples, so don't call it on the audio thread.
@ -240,7 +240,7 @@ public:
* method on the audio thread as it will spinlock.
*
*/
void emptyFileLoadingQueues() noexcept;
void emptyFileLoadingQueues();
/**
* @brief Wait for the background loading to finish for all promises
* in the queue.
@ -249,7 +249,7 @@ public:
private:
Logger& logger;
fs::path rootDirectory;
void loadingThread() noexcept;
void loadingThread();
void clearingThread();
void tryToClearPromises();