Changeset View
Changeset View
Standalone View
Standalone View
source/ps/TaskManager.cpp
Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void WorkerThread::RunUntilDeath() | void WorkerThread::RunUntilDeath() | ||||
{ | { | ||||
// The profiler does better if the names are unique. | // The profiler does better if the names are unique. | ||||
static std::atomic<int> n = 0; | static std::atomic<int> n = 0; | ||||
std::string name = "Task Mgr #" + std::to_string(n++); | std::string name = "Task Mgr #" + std::to_string(n++); | ||||
debug_SetThreadName(name.c_str()); | debug_SetThreadName(name.c_str()); | ||||
g_Profiler2.RegisterCurrentThread(name); | g_Profiler2->RegisterCurrentThread(name); | ||||
std::function<void()> task; | std::function<void()> task; | ||||
bool hasTask = false; | bool hasTask = false; | ||||
std::unique_lock<std::mutex> lock(m_Mutex, std::defer_lock); | std::unique_lock<std::mutex> lock(m_Mutex, std::defer_lock); | ||||
while (!m_Kill) | while (!m_Kill) | ||||
{ | { | ||||
lock.lock(); | lock.lock(); | ||||
Show All 25 Lines |
Wildfire Games · Phabricator