performance/Tutorial_MultiThreading.cpp
#include "common/oneworldenv.h"
#include "LabEngine/threading/workerthread.h"
namespace
{
#define TEST_ENV_CLASS OneWorldEnv
TEST_ENV {}
TUTORIAL
{
KT_LOG_TITLE_BEGIN("TUTORIAL - How to perform a single time-sliced query using the default queue of the world with processing on a worker thread.");
CHECK(env.LoadAndAddNavData(
"GeneratedNavData/canyon/canyon_1m_zup.NavData") !=
KY_NULL);
LabEngine::ScopedUseWorkerThread workerThread(env.GetGameWorld());
navWorld->PushAsyncQuery(query, Kaim::AsyncQueryDispatchId_PathFinder);
while (query->IsSafeToReadResult() == false)
{
navWorld->Update();
}
CHECK(query->IsSafeToReadResult() == true);
}
}