VirtualBox

Changeset 99966 in vbox


Ignore:
Timestamp:
May 25, 2023 8:35:13 AM (23 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157626
Message:

Shared Clipboard: Use a define for clipboard timeouts. bugref:9437

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-transfers.h

    r99955 r99966  
    8080/** Defines the default maximum object handles a Shared Clipboard transfer can have. */
    8181#define SHCL_TRANSFER_DEFAULT_MAX_OBJ_HANDLES   _4K
     82/** Defines the default timeout (in ms) to use for clipboard operations. */
     83#define SHCL_TIMEOUT_DEFAULT_MS                 RT_MS_30SEC
    8284
    8385/**
     
    941943    /** Absolute path to root entries. */
    942944    char                     *pszPathRootAbs;
    943     /** Timeout (in ms) for waiting of events. Default is 30s. */
     945    /** Timeout (in ms) for waiting of events. */
    944946    RTMSINTERVAL              uTimeoutMs;
    945947    /** Maximum data chunk size (in bytes) to transfer. Default is 64K. */
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r98103 r99966  
    635635                /* Don't block for too long here, as this also will screw other apps running on the OS. */
    636636                LogFunc(("Waiting for listing to arrive ...\n"));
    637                 rc = RTSemEventWait(m_EventListComplete, 30 * 1000 /* 30s timeout */);
     637                rc = RTSemEventWait(m_EventListComplete, VBOX_SHCL_TIMEOUT_DEFAULT_MS);
    638638                if (RT_SUCCESS(rc))
    639639                {
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp

    r99955 r99966  
    10601060    pTransfer->pszPathRootAbs    = NULL;
    10611061
    1062 #ifdef DEBUG_andy
    1063     pTransfer->uTimeoutMs     = RT_MS_5SEC;
    1064 #else
    1065     pTransfer->uTimeoutMs     = RT_MS_30SEC;
    1066 #endif
     1062    pTransfer->uTimeoutMs      = SHCL_TIMEOUT_DEFAULT_MS;
    10671063    pTransfer->cbMaxChunkSize  = cbMaxChunkSize;
    10681064    pTransfer->cMaxListHandles = cMaxListHandles;
     
    11261122    LogFlowFuncEnter();
    11271123
    1128     int rc = shClTransferThreadDestroy(pTransfer, 30 * 1000 /* Timeout in ms */);
     1124    int rc = shClTransferThreadDestroy(pTransfer, RT_MS_30SEC /* Timeout in ms */);
    11291125    if (RT_FAILURE(rc))
    11301126        return rc;
     
    19421938    if (RT_SUCCESS(rc))
    19431939    {
    1944         int rc2 = RTThreadUserWait(pTransfer->Thread.hThread, 30 * 1000 /* Timeout in ms */);
     1940        int rc2 = RTThreadUserWait(pTransfer->Thread.hThread, RT_MS_30SEC /* Timeout in ms */);
    19451941        AssertRC(rc2);
    19461942
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r98103 r99966  
    168168    {
    169169        PSHCLEVENTPAYLOAD pPayload;
    170         rc = ShClEventWait(pEvent, 30 * 1000, &pPayload);
     170        rc = ShClEventWait(pEvent, VBOX_SHCL_TIMEOUT_DEFAULT_MS, &pPayload);
    171171        if (RT_SUCCESS(rc))
    172172        {
     
    638638            if (RT_SUCCESS(rc))
    639639            {
    640                 int rc2 = RTThreadUserWait(pCtx->hThread, 30 * 1000 /* Timeout in ms */);
     640                int rc2 = RTThreadUserWait(pCtx->hThread, RT_MS_30SEC /* Timeout in ms */);
    641641                AssertRC(rc2);
    642642            }
     
    682682
    683683            /* Wait for the window thread to terminate. */
    684             rc = RTThreadWait(pCtx->hThread, 30 * 1000 /* Timeout in ms */, NULL);
     684            rc = RTThreadWait(pCtx->hThread, RT_MS_30SEC /* Timeout in ms */, NULL);
    685685            if (RT_FAILURE(rc))
    686686                LogRel(("Shared Clipboard: Waiting for window thread termination failed with rc=%Rrc\n", rc));
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r99953 r99966  
    288288            {
    289289                PSHCLEVENTPAYLOAD pPayload;
    290                 rc = ShClEventWait(pEvent, 30 * 1000, &pPayload);
     290                rc = ShClEventWait(pEvent, SHCL_TIMEOUT_DEFAULT_MS, &pPayload);
    291291                if (RT_SUCCESS(rc))
    292292                {
     
    469469
    470470            PSHCLEVENTPAYLOAD pPayload;
    471             rc = ShClEventWait(pEvent, 30 * 1000, &pPayload);
     471            rc = ShClEventWait(pEvent, SHCL_TIMEOUT_DEFAULT_MS, &pPayload);
    472472            if (RT_SUCCESS(rc))
    473473            {
     
    547547                /* X supplies the data asynchronously, so we need to wait for data to arrive first. */
    548548                PSHCLEVENTPAYLOAD pPayload;
    549                 rc = ShClEventWait(pEvent, 30 * 1000, &pPayload);
     549                rc = ShClEventWait(pEvent, SHCL_TIMEOUT_DEFAULT_MS, &pPayload);
    550550                if (RT_SUCCESS(rc))
    551551                {
Note: See TracChangeset for help on using the changeset viewer.

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