Changeset View
Changeset View
Standalone View
Standalone View
source/ps/UserReport.cpp
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | if (now > m_LastUpdateTime + TIMER_CHECK_INTERVAL) | ||||
m_LastUpdateTime = now; | m_LastUpdateTime = now; | ||||
} | } | ||||
} | } | ||||
private: | private: | ||||
static void RunThread(CUserReporterWorker* data) | static void RunThread(CUserReporterWorker* data) | ||||
{ | { | ||||
debug_SetThreadName("CUserReportWorker"); | debug_SetThreadName("CUserReportWorker"); | ||||
g_Profiler2.RegisterCurrentThread("userreport"); | g_Profiler2->RegisterCurrentThread("userreport"); | ||||
data->Run(); | data->Run(); | ||||
} | } | ||||
void Run() | void Run() | ||||
{ | { | ||||
// Set libcurl's proxy configuration | // Set libcurl's proxy configuration | ||||
// (This has to be done in the thread because it's potentially very slow) | // (This has to be done in the thread because it's potentially very slow) | ||||
Show All 22 Lines | void Run() | ||||
* processing fewer actions than wakeups. | * processing fewer actions than wakeups. | ||||
* | * | ||||
* Retransmission timeouts are triggered via the main thread. | * Retransmission timeouts are triggered via the main thread. | ||||
*/ | */ | ||||
// Wait until the main thread wakes us up | // Wait until the main thread wakes us up | ||||
while (true) | while (true) | ||||
{ | { | ||||
g_Profiler2.RecordRegionEnter("condition_variable wait"); | g_Profiler2->RecordRegionEnter("condition_variable wait"); | ||||
std::unique_lock<std::mutex> lock(m_WorkerMutex); | std::unique_lock<std::mutex> lock(m_WorkerMutex); | ||||
m_WorkerCV.wait(lock); | m_WorkerCV.wait(lock); | ||||
lock.unlock(); | lock.unlock(); | ||||
g_Profiler2.RecordRegionLeave(); | g_Profiler2->RecordRegionLeave(); | ||||
// Handle shutdown requests as soon as possible | // Handle shutdown requests as soon as possible | ||||
if (GetShutdown()) | if (GetShutdown()) | ||||
return; | return; | ||||
// If we're not enabled, ignore this wakeup | // If we're not enabled, ignore this wakeup | ||||
if (!GetEnabled()) | if (!GetEnabled()) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 353 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator