VirtualBox

Changeset 1646 in vbox


Ignore:
Timestamp:
Mar 22, 2007 6:57:25 PM (18 years ago)
Author:
vboxsync
Message:

Converted from active waiting to RTThreadWait.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r1533 r1646  
    248248        return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_BELOW, RT_SRC_POS, N_("Char#%d has no stream interface below"), pDrvIns->iInstance);
    249249
    250     rc = RTThreadCreate(&pData->ReceiveThread, drvCharReceiveLoop, (void *)pData, 0, RTTHREADTYPE_IO, 0, "Char");
     250    rc = RTThreadCreate(&pData->ReceiveThread, drvCharReceiveLoop, (void *)pData, 0, RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "Char");
    251251    if (VBOX_FAILURE(rc))
    252252        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("Char#%d cannot create receive thread"), pDrvIns->iInstance);
     
    273273     * (the api is relatively new, which is why it's not used in all the places it should.) */
    274274    pData->fShutdown = true;
    275     for (int i = 0; i < 100; i++)
    276     {
    277         if (pData->ReceiveThread == NIL_RTTHREAD)
    278             break;
    279         RTThreadSleep(100);
    280     }
     275    RTThreadWait(pData->ReceiveThread, 1000, NULL);
    281276    if (pData->ReceiveThread != NIL_RTTHREAD)
    282277        LogRel(("Char%d: receive thread did not terminate\n", pDrvIns->iInstance));
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