VirtualBox

Changeset 106786 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Oct 30, 2024 11:33:02 AM (3 months ago)
Author:
vboxsync
Message:

Additions: Linux/Wayland: Rename VBClClipboardThreadStart to vbcl_wayland_thread_start and put it into common place, bugref:10796.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard-common.cpp

    r106061 r106786  
    4141#include "VBoxClient.h"
    4242#include "clipboard.h"
    43 
    44 RTDECL(int) VBClClipboardThreadStart(PRTTHREAD pThread, PFNRTTHREAD pfnThread, const char *pszName, void *pvUser)
    45 {
    46     int rc;
    47 
    48     rc = RTThreadCreate(pThread, pfnThread, pvUser, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, pszName);
    49     if (RT_SUCCESS(rc))
    50         rc = RTThreadUserWait(*pThread, RT_MS_30SEC /* msTimeout */);
    51 
    52     if (RT_SUCCESS(rc))
    53         VBClLogVerbose(1, "started %s thread\n", pszName);
    54     else
    55         LogRel(("unable to start %s thread, rc=%Rrc\n", pszName, rc));
    56 
    57     return rc;
    58 }
    5943
    6044RTDECL(int) VBClClipboardReadHostEvent(PSHCLCONTEXT pCtx, const PFNHOSTCLIPREPORTFMTS pfnHGClipReport,
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard.h

    r106061 r106786  
    8484
    8585/**
    86  * Create thread and wait until it started.
    87  *
    88  * @returns IPRT status code.
    89  * @param   pThread     Pointer to thread data.
    90  * @param   pfnThread   Pointer to thread main loop function.
    91  * @param   pszName     Thread name.
    92  * @param   pvUser      User data.
    93  */
    94 RTDECL(int) VBClClipboardThreadStart(PRTTHREAD pThread, PFNRTTHREAD pfnThread, const char *pszName, void *pvUser);
    95 
    96 /**
    9786 * Read and process one event from the host clipboard service.
    9887 *
  • trunk/src/VBox/Additions/x11/VBoxClient/vboxwl.cpp

    r106061 r106786  
    573573    RTLOCALIPCSESSION hIpcSession;
    574574
    575     rc = VBClClipboardThreadStart(&g_AppThread, vboxwl_gtk_worker, "gtk-app", NULL);
     575    rc = vbcl_wayland_thread_start(&g_AppThread, vboxwl_gtk_worker, "gtk-app", NULL);
    576576    if (RT_SUCCESS(rc))
    577577    {
  • trunk/src/VBox/Additions/x11/VBoxClient/wayland-helper-dcp.cpp

    r106771 r106786  
    12751275    vbcl_wayland_session_init(&g_DcpCtx.Session.Base);
    12761276
    1277     return VBClClipboardThreadStart(&g_DcpCtx.Thread, vbcl_wayland_hlp_dcp_event_loop, "wl-dcp", &g_DcpCtx);
     1277    return vbcl_wayland_thread_start(&g_DcpCtx.Thread, vbcl_wayland_hlp_dcp_event_loop, "wl-dcp", &g_DcpCtx);
    12781278}
    12791279
  • trunk/src/VBox/Additions/x11/VBoxClient/wayland-helper-gtk.cpp

    r106771 r106786  
    410410    RT_ZERO(g_GtkCtx);
    411411
    412     return VBClClipboardThreadStart(&g_GtkCtx.Thread, vbcl_wayland_hlp_gtk_worker, "wl-gtk-ipc", &g_GtkCtx);
     412    return vbcl_wayland_thread_start(&g_GtkCtx.Thread, vbcl_wayland_hlp_gtk_worker, "wl-gtk-ipc", &g_GtkCtx);
    413413}
    414414
  • trunk/src/VBox/Additions/x11/VBoxClient/wayland-helper.cpp

    r106061 r106786  
    315315    return RT_BOOL(ASMAtomicReadU8((volatile uint8_t *)&pSession->enmState) == VBCL_WL_SESSION_STATE_STARTED);
    316316}
     317
     318RTDECL(int) vbcl_wayland_thread_start(PRTTHREAD pThread, PFNRTTHREAD pfnThread, const char *pszName, void *pvUser)
     319{
     320    int rc;
     321
     322    rc = RTThreadCreate(pThread, pfnThread, pvUser, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, pszName);
     323    if (RT_SUCCESS(rc))
     324        rc = RTThreadUserWait(*pThread, RT_MS_30SEC /* msTimeout */);
     325
     326    if (RT_SUCCESS(rc))
     327        VBClLogVerbose(1, "started %s thread\n", pszName);
     328    else
     329        LogRel(("unable to start %s thread, rc=%Rrc\n", pszName, rc));
     330
     331    return rc;
     332}
     333
  • trunk/src/VBox/Additions/x11/VBoxClient/wayland-helper.h

    r106753 r106786  
    399399RTDECL(bool) vbcl_wayland_session_is_started(vbcl_wl_session_t *pSession);
    400400
     401/**
     402 * Create thread and wait until it started.
     403 *
     404 * @returns IPRT status code.
     405 * @param   pThread     Pointer to thread data.
     406 * @param   pfnThread   Pointer to thread main loop function.
     407 * @param   pszName     Thread name.
     408 * @param   pvUser      User data.
     409 */
     410RTDECL(int) vbcl_wayland_thread_start(PRTTHREAD pThread, PFNRTTHREAD pfnThread, const char *pszName, void *pvUser);
     411
    401412/** Wayland helper which uses GTK library. */
    402413extern const VBCLWAYLANDHELPER g_WaylandHelperGtk;
  • trunk/src/VBox/Additions/x11/VBoxClient/wayland.cpp

    r106753 r106786  
    309309    if (RT_VALID_PTR(g_pWaylandHelperClipboard))
    310310    {
    311         rc = VBClClipboardThreadStart(&g_ClipboardThread, vbclWaylandClipboardWorker, "wl-clip", NULL);
     311        rc = vbcl_wayland_thread_start(&g_ClipboardThread, vbclWaylandClipboardWorker, "wl-clip", NULL);
    312312        VBClLogVerbose(1, "clipboard thread started, rc=%Rrc\n", rc);
    313313    }
     
    317317        && RT_VALID_PTR(g_pWaylandHelperDnd))
    318318    {
    319         rc = VBClClipboardThreadStart(&g_DndThread, vbclWaylandDndWorker, "wl-dnd", NULL);
     319        rc = vbcl_wayland_thread_start(&g_DndThread, vbclWaylandDndWorker, "wl-dnd", NULL);
    320320        VBClLogVerbose(1, "DnD thread started, rc=%Rrc\n", rc);
    321321    }
     
    324324    if (RT_SUCCESS(rc))
    325325    {
    326         rc = VBClClipboardThreadStart(&g_HostInputFocusThread, vbclWaylandHostInputFocusWorker, "wl-focus", NULL);
     326        rc = vbcl_wayland_thread_start(&g_HostInputFocusThread, vbclWaylandHostInputFocusWorker, "wl-focus", NULL);
    327327        VBClLogVerbose(1, "host input focus polling thread started, rc=%Rrc\n", rc);
    328328    }
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