1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Check for jobs using predicate

This commit is contained in:
elsid 2019-02-19 03:05:15 +03:00
parent c05fc9e054
commit ece111d05a
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -162,9 +162,7 @@ namespace DetourNavigator
boost::optional<AsyncNavMeshUpdater::Job> AsyncNavMeshUpdater::getNextJob()
{
std::unique_lock<std::mutex> lock(mMutex);
if (mJobs.empty())
mHasJob.wait_for(lock, std::chrono::milliseconds(10));
if (mJobs.empty())
if (!mHasJob.wait_for(lock, std::chrono::milliseconds(10), [&] { return !mJobs.empty(); }))
{
mFirstStart.lock()->reset();
mDone.notify_all();