VirtualBox

Changeset 4624 in vbox


Ignore:
Timestamp:
Sep 8, 2007 6:32:00 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
24270
Message:

The USE_PDMTHREAD stuff seems to work fine, dropped the old code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r4623 r4624  
    4646 */
    4747
    48 /** To enable the PDMThread based send thread code.
    49  * This is just a emergency switch in case changes doesn't quite work and
    50  * we want to get 1.5 out.
    51  * @todo cleanup after 1.5.  */
    52 #define USE_PDMTHREAD 1
    53 
    5448/*******************************************************************************
    5549*   Header Files                                                               *
     
    223217    /** Async send thread */
    224218    RTSEMEVENT                          hSendEventSem;
    225 #ifdef USE_PDMTHREAD
    226219    /** The Async send thread. */
    227220    PPDMTHREAD                          pSendThread;
    228 #else
    229     RTTHREAD                            hSendThread;
    230 #endif
    231221
    232222    /** Access critical section. */
     
    20572047                    {
    20582048                        int rc = pcnetXmitCompleteFrame(pData);
    2059 #ifdef USE_PDMTHREAD
    20602049                        AssertRCReturn(rc, rc);
    2061 #else
    2062                         if (VBOX_FAILURE(rc))
    2063                             return rc; /* can happen during termination */
    2064 #endif
    20652050                    }
    20662051                }
     
    21682153                    {
    21692154                        int rc = pcnetXmitCompleteFrame(pData);
    2170 #ifdef USE_PDMTHREAD
    21712155                        AssertRCReturn(rc, rc);
    2172 #else
    2173                         if (VBOX_FAILURE(rc))
    2174                             return rc; /* can happen during termination */
    2175 #endif
    21762156                    }
    21772157                    else if (CSR_LOOP(pData) && !fDropFrame)
     
    22362216
    22372217
    2238 #ifdef USE_PDMTHREAD
    22392218/**
    22402219 * Async I/O thread for delayed sending of packets.
     
    23092288    return RTSemEventSignal(pThis->hSendEventSem);
    23102289}
    2311 
    2312 
    2313 #else /* USE_PDMTHREAD */
    2314 /**
    2315  * Async I/O thread for delayed sending of packets.
    2316  */
    2317 static DECLCALLBACK(int) pcnetAsyncSend(RTTHREAD ThreadSelf, void *pvUser)
    2318 {
    2319     PCNetState *pData = (PCNetState *)pvUser;
    2320     RTSEMEVENT hEvent = pData->hSendEventSem;
    2321     int        rc     = VINF_SUCCESS;
    2322 
    2323     while(rc == VINF_SUCCESS)
    2324     {
    2325         rc = RTSemEventWait(hEvent, RT_INDEFINITE_WAIT);
    2326         if (VBOX_FAILURE(rc))
    2327             break;
    2328 
    2329         rc = PDMCritSectEnter(&pData->CritSect, VERR_PERMISSION_DENIED);
    2330         AssertReleaseRC(rc);
    2331 
    2332         if (!pData->fSaving)
    2333             rc = pcnetAsyncTransmit(pData);
    2334 
    2335         PDMCritSectLeave(&pData->CritSect);
    2336     }
    2337     return VINF_SUCCESS;
    2338 }
    2339 #endif /* USE_PDMTHREAD */
    23402290
    23412291#endif /* IN_RING3 */
     
    41664116    if (PDMCritSectIsInitialized(&pData->CritSect))
    41674117    {
    4168 #ifdef USE_PDMTHREAD
    41694118        /*
    41704119         * At this point the send thread is suspended and will not enter
     
    41754124        pData->hSendEventSem = NIL_RTSEMEVENT;
    41764125        PDMR3CritSectDelete(&pData->CritSect);
    4177 #else
    4178         PDMCritSectEnter(&pData->CritSect, VERR_ACCESS_DENIED);
    4179 
    4180         RTSemEventDestroy(pData->hSendEventSem);
    4181         pData->hSendEventSem = 0;
    4182 
    4183         PDMCritSectLeave(&pData->CritSect);
    4184         PDMR3CritSectDelete(&pData->CritSect);
    4185 #endif
    41864126    }
    41874127    return VINF_SUCCESS;
     
    44544394
    44554395    /* Create asynchronous thread */
    4456 #ifdef USE_PDMTHREAD
    44574396    rc = PDMDevHlpPDMThreadCreate(pDevIns, &pData->pSendThread, pData, pcnetAsyncSendThread, pcnetAsyncSendThreadWakeUp, 0, RTTHREADTYPE_IO, "PCNET_SEND");
    44584397    AssertRCReturn(rc, rc);
    4459 #else
    4460     rc = RTThreadCreate(&pData->hSendThread, pcnetAsyncSend, (void *)pData, 128*1024, RTTHREADTYPE_IO, 0, "PCNET_SEND");
    4461     AssertRC(rc);
    4462 #endif
    44634398
    44644399#ifdef VBOX_WITH_STATISTICS
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