VirtualBox

Ignore:
Timestamp:
Jul 6, 2021 11:19:50 AM (4 years ago)
Author:
vboxsync
Message:

Additions: X11: seamless: prevent hang on shutdown (2), bugref:10032.

When X11 is no longer running, XCloseDisplay() call will indefinitely
hang on internal X11 mutex preventing service from shutdown. In this
commit, on shutdown code path, we examine if XOpenDisplay() returns non-NULL,
meaning that X server is still running, and only after this XCloseDisplay()
is called. In theory, this check still might not work (in case of bad timing),
but in general it improves sutuation and service is able to terminate smoothly.

In addition, before calling XNextEvent(), X11 monitor thread attempts to examine
with XPending() if there are some events actually pending. This is needed because
XNextEvent() might wait forever for the next event to arrive and block service
termination.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp

    r86416 r90057  
    316316    event_return->xmap.window = g_SmlsEventWindow;
    317317    return True;
     318}
     319
     320/* Mock XNextEvent(): this also should not be needed. Just in case, always
     321 * return that at least one event is pending to be processed. */
     322extern "C" int XPending(Display *display);
     323int XPending(Display *display)
     324{
     325    RT_NOREF1(display);
     326    return 1;
    318327}
    319328
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette