Changeset 1778 in vbox
- Timestamp:
- Mar 28, 2007 3:17:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp
r1777 r1778 37 37 #include <iprt/alloc.h> 38 38 #include <iprt/string.h> 39 #include <iprt/semaphore.h> 39 40 40 41 #include "Builtins.h" … … 83 84 /* Overlapped structure for reads. */ 84 85 OVERLAPPED OverlappedRead; 86 /* Listen thread wakeup semaphore */ 87 RTSEMEVENT ListenSem; 85 88 #else /* !__WIN__ */ 86 89 /** Socket handle of the local socket for server. */ … … 356 359 if (hrc == ERROR_PIPE_CONNECTED) 357 360 { 358 RT ThreadSleep(250);361 RTSemEventWait(pData->ListenSem, 250); 359 362 } 360 363 else … … 396 399 CloseHandle(hEvent); 397 400 #endif 401 pData->ListenThread = NIL_RTTHREAD; 398 402 return VINF_SUCCESS; 399 403 } … … 474 478 if VBOX_FAILURE(rc) 475 479 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NamedPipe#%d failed to create listening thread\n"), pDrvIns->iInstance); 480 481 rc = RTSemEventCreate(&pData->ListenSem); 482 AssertRC(rc); 476 483 } 477 484 else … … 487 494 pData->OverlappedWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); 488 495 pData->OverlappedRead.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); 489 490 496 #else /* !__WIN__ */ 491 497 int s; … … 561 567 CloseHandle(pData->OverlappedWrite.hEvent); 562 568 } 569 /* Wake up listen thread */ 570 RTSemEventSignal(pData->ListenSem); 571 RTSemEventDestroy(pData->ListenSem); 563 572 #else /* !__WIN__ */ 564 573 if (pData->fIsServer) … … 575 584 } 576 585 #endif /* !__WIN__ */ 586 587 if (pData->ListenThread) 588 { 589 RTThreadWait(pData->ListenThread, 250, NULL); 590 if (pData->ListenThread != NIL_RTTHREAD) 591 LogRel(("NamedPipe%d: listen thread did not terminate\n", pDrvIns->iInstance)); 592 } 593 577 594 if (pData->pszLocation) 578 595 MMR3HeapFree(pData->pszLocation);
Note:
See TracChangeset
for help on using the changeset viewer.