More threadpool bs

This commit is contained in:
Dynamitos committed 2021-12-02 13:00:03 +01:00
1 parent 5fafdda770
commit 9e3a2446ce
37 files changed
+488 -541

No files matched your search

-15
View File
@@ -35,24 +35,9 @@ public:
{
std::unique_lock lck(lock);
this->status = status;
if(status == Status::Ready)
{
readyCV.notify_all();
}
}
protected:
inline void waitReady()
{
std::unique_lock lck(lock);
if(status != Status::Ready)
{
std::cout << "Asset " << name.generic_string() << " not ready yet, waiting" << std::endl;
readyCV.wait(lck);
std::cout << "Asset " << name.generic_string() << " now ready, continuing" << std::endl;
}
}
std::mutex lock;
std::condition_variable readyCV;
std::ifstream& getReadStream();
std::ofstream& getWriteStream();
private: