Changeset 98594 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
- Timestamp:
- Feb 15, 2023 4:48:37 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
r98474 r98594 32 32 #include <iprt/mem.h> 33 33 #include <iprt/string.h> 34 #include <iprt/asm.h> 34 35 35 36 #include <X11/Xlib.h> … … 146 147 /** Main loop: handle display hot-plug events, property updates (which can 147 148 * signal VT switches hot-plug in old X servers). */ 148 static void runDisplay(struct DISPLAYSTATE *pState )149 static void runDisplay(struct DISPLAYSTATE *pState, bool volatile *pfShutdown) 149 150 { 150 151 Display *pDisplay = pState->pDisplay; … … 166 167 * against spontaneous termination, especially as it will never get 167 168 * properly tested, so I will go for the second. */ 168 while ( true)169 while (!ASMAtomicReadBool(pfShutdown)) 169 170 { 170 171 XEvent event; … … 281 282 static DECLCALLBACK(int) run(bool volatile *pfShutdown) 282 283 { 283 RT_NOREF(pfShutdown); /** @todo Probably very wrong not to check pfShutdown... Especially given no pfnStop implementation. */284 284 struct DISPLAYSTATE *pSelf = &g_DisplayState; 285 285 286 286 if (!pSelf->mfInit) 287 287 return VERR_WRONG_ORDER; 288 runDisplay(pSelf); 289 return VERR_INTERNAL_ERROR; /* "Should never reach here." */ 288 289 runDisplay(pSelf, pfShutdown); 290 291 return VINF_SUCCESS; 292 } 293 294 /** 295 * @interface_method_impl{VBCLSERVICE,pfnStop} 296 */ 297 static DECLCALLBACK(void) stop(void) 298 { 299 /* Nothing to do here. Implement empty callback, so 300 * main thread can set pfShutdown=true on process termination. */ 290 301 } 291 302 … … 300 311 init, /* pfnInit */ 301 312 run, /* pfnWorker */ 302 NULL, /* pfnStop */313 stop, /* pfnStop */ 303 314 NULL, /* pfnTerm */ 304 315 };
Note:
See TracChangeset
for help on using the changeset viewer.