Changeset 14199 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 14, 2008 8:28:11 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14196 r14199 81 81 /*used for wakep of poling thread*/ 82 82 RTSEMEVENT semSndMutex; 83 RTSEMEVENT semLinkMutex; 83 84 #ifndef RT_OS_WINDOWS 84 85 /** The write end of the control pipe. */ … … 194 195 case PDMNETWORKLINKSTATE_UP: 195 196 LogRel(("NAT: link up\n")); 197 #ifndef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 196 198 slirp_link_up(pThis->pNATState); 197 # ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC199 #else 198 200 # ifndef RT_OS_WINDOWS 199 201 rc = RTFileWrite(pThis->PipeWrite, "2", 2, NULL); … … 208 210 case PDMNETWORKLINKSTATE_DOWN_RESUME: 209 211 LogRel(("NAT: link down\n")); 212 #ifndef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 210 213 slirp_link_down(pThis->pNATState); 211 # ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC214 #else 212 215 # ifndef RT_OS_WINDOWS 213 216 rc = RTFileWrite(pThis->PipeWrite, "2", 2, NULL); … … 215 218 # else 216 219 WSASetEvent(pThis->hNetEvent); 220 RTSemEventWait(pThis->semLinkMutex, RT_INDEFINITE_WAIT); 217 221 # endif 218 222 #endif … … 350 354 } 351 355 if ((event - WSA_WAIT_EVENT_0) == VBOX_NET_EVENT_INDEX) { 352 WSAResetEvent(pThis->hNetEvent); 353 break; 354 } 356 switch(pThis->enmLinkState) { 357 case PDMNETWORKLINKSTATE_UP: 358 slirp_link_up(pThis->pNATState); 359 break; 360 case PDMNETWORKLINKSTATE_DOWN: 361 case PDMNETWORKLINKSTATE_DOWN_RESUME: 362 slirp_link_down(pThis->pNATState); 363 break; 364 } 365 WSAResetEvent(pThis->hNetEvent); 366 RTSemEventSignal(pThis->semLinkMutex); 367 break; 368 } 355 369 # endif /* RT_OS_WINDOWS */ 356 370 } … … 476 490 RTCritSectDelete(&pThis->CritSect); 477 491 #else 492 RTSemEventDestroy(pThis->semLinkMutex); 478 493 RTSemEventDestroy(pThis->semSndMutex); 479 494 #endif … … 709 724 pDrvIns->pDrvHlp->pfnPDMPollerRegister(pDrvIns, drvNATPoller); 710 725 #else 726 rc = RTSemEventCreate(&pThis->semLinkMutex); 727 AssertReleaseRC(rc); 711 728 rc = RTSemEventCreate(&pThis->semSndMutex); 712 729 AssertReleaseRC(rc); … … 728 745 pThis->hSendEvent = WSACreateEvent(); 729 746 pThis->hNetEvent = WSACreateEvent(); 730 731 747 slirp_register_external_event(pThis->pNATState, pThis->hSendEvent, VBOX_SEND_EVENT_INDEX); 748 slirp_register_external_event(pThis->pNATState, pThis->hNetEvent, VBOX_NET_EVENT_INDEX); 732 749 # endif 733 750
Note:
See TracChangeset
for help on using the changeset viewer.