- Timestamp:
- Jul 20, 2023 9:55:41 AM (19 months ago)
- svn:sync-xref-src-repo-rev:
- 158499
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-transfers.h
r100636 r100660 1129 1129 int ShClTransferRun(PSHCLTRANSFER pTransfer, PFNSHCLTRANSFERTHREAD pfnThreadFunc, void *pvUser); 1130 1130 int ShClTransferStart(PSHCLTRANSFER pTransfer); 1131 int ShClTransferStop(PSHCLTRANSFER pTransfer); 1131 1132 int ShClTransferComplete(PSHCLTRANSFER pTransfer); 1132 1133 int ShClTransferCancel(PSHCLTRANSFER pTransfer); -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
r100649 r100660 1224 1224 pTransfer->cObjHandles = 0; 1225 1225 pTransfer->uObjHandleNext = 1; 1226 1227 pTransfer->Thread.fStarted = false; 1228 pTransfer->Thread.fStop = false; 1229 pTransfer->Thread.fCancelled = false; 1226 1230 1227 1231 int rc = shClTransferSetStatus(pTransfer, SHCLTRANSFERSTATUS_INITIALIZED); … … 2214 2218 2215 2219 /** 2220 * Stops a started transfer. 2221 * 2222 * @returns VBox status code. 2223 * @param pTransfer Clipboard transfer to stop. 2224 */ 2225 int ShClTransferStop(PSHCLTRANSFER pTransfer) 2226 { 2227 AssertPtrReturn(pTransfer, VERR_INVALID_POINTER); 2228 2229 LogFlowFuncEnter(); 2230 2231 int rc = shClTransferThreadDestroy(pTransfer, SHCL_TIMEOUT_DEFAULT_MS); 2232 2233 LogFlowFuncLeaveRC(rc); 2234 return rc; 2235 } 2236 2237 /** 2216 2238 * Completes a transfer (as successful). 2217 2239 * … … 2431 2453 * Destroys the thread of a clipboard transfer. 2432 2454 * 2433 * @returns VBox status code. 2455 * @returns VBox status code. Will return thread rc. 2434 2456 * @param pTransfer Clipboard transfer to destroy thread for. 2435 2457 * @param uTimeoutMs Timeout (in ms) to wait for thread destruction. … … 2441 2463 shClTransferLock(pTransfer); 2442 2464 2443 if ( pTransfer->Thread.hThread == NIL_RTTHREAD)2465 if (!pTransfer->Thread.fStarted) 2444 2466 { 2445 2467 shClTransferUnlock(pTransfer); … … 2455 2477 2456 2478 int rcThread = VERR_IPE_UNINITIALIZED_STATUS; 2479 Assert(pTransfer->Thread.hThread != NIL_RTTHREAD); 2457 2480 int rc = RTThreadWait(pTransfer->Thread.hThread, uTimeoutMs, &rcThread); 2458 2481 2459 2482 LogFlowFunc(("Waiting for thread resulted in %Rrc (thread exited with %Rrc)\n", rc, rcThread)); 2460 2483 2484 if (RT_SUCCESS(rc)) 2485 { 2486 pTransfer->Thread.fStarted = false; 2487 pTransfer->Thread.hThread = NIL_RTTHREAD; 2488 2489 rc = rcThread; /* Return the thread rc to the caller. */ 2490 } 2491 else 2492 LogRel(("Shared Clipboard: Waiting for thread of transfer %RU16 failed with %Rrc\n", pTransfer->State.uID, rc)); 2493 2494 LogFlowFuncLeaveRC(rc); 2461 2495 return rc; 2462 2496 }
Note:
See TracChangeset
for help on using the changeset viewer.