You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 33d7caf
Browse filesBrowse the repository at this point in the historyBrowse files
constauto period = std::chrono::duration_cast<std::chrono::steady_clock::duration>(std::chrono::duration<double>(1. / cfg.fpsRate));// TODO: wake up on HasExternalGUISignals
89
+
constauto period = std::chrono::duration_cast<std::chrono::steady_clock::duration>(std::chrono::duration<double>(1. / cfg.fpsRate));
91
90
mNextFrameTime += period;
92
91
if (mNextFrameTime < now - period) { // More than one frame behind (slow rendering, first frame), do not try to catch up
Copy file name to clipboardExpand all lines: GPU/GPUTracking/display/frontend/GPUDisplayFrontend.h
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@
20
20
#include<memory>
21
21
#include<chrono>
22
22
#include<mutex>
23
+
#include<condition_variable>
23
24
#include<string>
24
25
#include<vector>
25
26
@@ -84,7 +85,8 @@ class GPUDisplayFrontend : public GPUDisplayFrontendInterface
84
85
virtualint32_tFrontendMain() = 0;
85
86
virtualvoidStopDisplayA();
86
87
staticvoid* FrontendThreadWrapper(void*);
87
-
voidwaitForFPSLimit(); // Sleep until the next frame is due according to fpsRate (only in FPS_LIMIT_RATE mode, see GPUDisplayBackend::fpsLimitMode)
88
+
voidwaitForFPSLimit(); // Sleep until the next frame is due according to fpsRate (only in FPS_LIMIT_RATE mode, see GPUDisplayBackend::fpsLimitMode), or until an external config update is signalled
89
+
voidsignalConfigUpdate(); // Signal a config update from an external source (console keys, Qt GUI), wakes up waitForFPSLimit
@@ -99,7 +101,11 @@ class GPUDisplayFrontend : public GPUDisplayFrontendInterface
99
101
100
102
std::mutex mExternalGUIKeyMutex;
101
103
std::vector<int32_t> mExternalGUIKeys; // Keys sent by external entity (usually console), may be ignored by backend.
104
+
std::mutex mConfigUpdateMutex;
105
+
std::condition_variable mConfigUpdateCV; // Notified by signalConfigUpdate
106
+
boolmConfigUpdatePending = false; // Protected by mConfigUpdateMutex, set by signalConfigUpdate, cleared by HandleExternalGUISignals
102
107
std::mutex mExitStateMutex;
108
+
std::condition_variable mDisplayStoppedCV; // Notified with mExitStateMutex held when the frontend sets mDisplayRunning to false, StopDisplay waits for it
0 commit comments