VirtualBox

Changeset 1646

Show
Ignore:
Timestamp:
03/22/07 19:57:25 (2 years ago)
Author:
vboxsync
Message:

Converted from active waiting to RTThreadWait.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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)); 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy