More threadpool bs
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user