mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 02:15:32 +00:00
Check for jobs using predicate
This commit is contained in:
parent
c05fc9e054
commit
ece111d05a
1 changed files with 1 additions and 3 deletions
|
@ -162,9 +162,7 @@ namespace DetourNavigator
|
||||||
boost::optional<AsyncNavMeshUpdater::Job> AsyncNavMeshUpdater::getNextJob()
|
boost::optional<AsyncNavMeshUpdater::Job> AsyncNavMeshUpdater::getNextJob()
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(mMutex);
|
std::unique_lock<std::mutex> lock(mMutex);
|
||||||
if (mJobs.empty())
|
if (!mHasJob.wait_for(lock, std::chrono::milliseconds(10), [&] { return !mJobs.empty(); }))
|
||||||
mHasJob.wait_for(lock, std::chrono::milliseconds(10));
|
|
||||||
if (mJobs.empty())
|
|
||||||
{
|
{
|
||||||
mFirstStart.lock()->reset();
|
mFirstStart.lock()->reset();
|
||||||
mDone.notify_all();
|
mDone.notify_all();
|
||||||
|
|
Loading…
Reference in a new issue