Remove noexcept with RTSemaphores in
This commit is contained in:
parent
becdff5969
commit
758da22bd7
2 changed files with 11 additions and 7 deletions
|
|
@ -108,7 +108,11 @@ sfz::FilePool::~FilePool()
|
||||||
quitThread = true;
|
quitThread = true;
|
||||||
|
|
||||||
for (unsigned i = 0; i < threadPool.size(); ++i)
|
for (unsigned i = 0; i < threadPool.size(); ++i)
|
||||||
workerBarrier.post();
|
try {
|
||||||
|
workerBarrier.post();
|
||||||
|
} catch (std::exception e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& thread: threadPool)
|
for (auto& thread: threadPool)
|
||||||
thread.join();
|
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()) {
|
if (emptyPromises.empty()) {
|
||||||
DBG("[sfizz] No empty promises left to honor the one for " << filename);
|
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;
|
FilePromisePtr promise;
|
||||||
while (!quitThread) {
|
while (!quitThread) {
|
||||||
|
|
@ -443,7 +447,7 @@ uint32_t sfz::FilePool::getPreloadSize() const noexcept
|
||||||
return preloadSize;
|
return preloadSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sfz::FilePool::emptyFileLoadingQueues() noexcept
|
void sfz::FilePool::emptyFileLoadingQueues()
|
||||||
{
|
{
|
||||||
emptyQueue = true;
|
emptyQueue = true;
|
||||||
workerBarrier.post();
|
workerBarrier.post();
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ public:
|
||||||
* @param filename the file to preload
|
* @param filename the file to preload
|
||||||
* @return FilePromisePtr a file promise
|
* @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
|
* @brief Change the preloading size. This will trigger a full
|
||||||
* reload of all samples, so don't call it on the audio thread.
|
* 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.
|
* 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
|
* @brief Wait for the background loading to finish for all promises
|
||||||
* in the queue.
|
* in the queue.
|
||||||
|
|
@ -249,7 +249,7 @@ public:
|
||||||
private:
|
private:
|
||||||
Logger& logger;
|
Logger& logger;
|
||||||
fs::path rootDirectory;
|
fs::path rootDirectory;
|
||||||
void loadingThread() noexcept;
|
void loadingThread();
|
||||||
void clearingThread();
|
void clearingThread();
|
||||||
void tryToClearPromises();
|
void tryToClearPromises();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue