VirtualBox

Changeset 100664 in vbox


Ignore:
Timestamp:
Jul 20, 2023 10:22:27 AM (17 months ago)
Author:
vboxsync
Message:

Shared Clipboard: Windows data object locking fixes. bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r100546 r100664  
    186186    LogFlowFuncEnter();
    187187
    188     /* Let waiters know. */
    189     setStatusLocked(Uninitialized, VINF_SUCCESS);
    190 
    191     /* Make sure to release the transfer. */
    192     setTransferLocked(NULL);
     188    lock();
     189
     190    if (m_enmStatus != Uninitialized)
     191    {
     192
     193        /* Let the read thread know. */
     194        setStatusLocked(Uninitialized, VINF_SUCCESS);
     195
     196        /* Make sure to unlock before stopping the read thread. */
     197        unlock();
     198
     199        /* Stop the read thread. */
     200        if (m_pTransfer)
     201            ShClTransferStop(m_pTransfer);
     202
     203        lock();
     204
     205        /* Make sure to release the transfer. */
     206        setTransferLocked(NULL);
     207    }
     208
     209    unlock();
    193210}
    194211
     
    200217    LogFlowFuncEnter();
    201218
    202     lock();
    203 
    204219    uninitInternal();
    205 
    206     unlock();
    207220}
    208221
     
    217230        return;
    218231
    219     lock();
    220 
    221232    uninitInternal();
    222 
    223     unlock();
    224233
    225234    int rc = RTCritSectDelete(&m_CritSect);
     
    552561                for (;;)
    553562                {
     563                    if (ASMAtomicReadBool(&pTransfer->Thread.fStop))
     564                        break;
     565
    554566                    pThis->unlock();
    555567
     
    13151327        LogRel(("Shared Clipboard: Data object received error %Rrc (status %#x)\n", rc, enmStatus));
    13161328
    1317     if (m_EventStatusChanged != NIL_RTSEMEVENT)
    1318         rc2 = RTSemEventSignal(m_EventStatusChanged);
    1319 
     1329    rc2 = RTSemEventSignal(m_EventStatusChanged);
     1330
     1331    LogFlowFuncLeaveRC(rc2);
    13201332    return rc2;
    13211333}
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