VirtualBox

Changeset 25598 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Dec 31, 2009 12:36:57 AM (15 years ago)
Author:
vboxsync
Message:

iprt/thread.h: Added RTThreadGetState, fixed busted RTThreadBlocking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/thread.cpp

    r25528 r25598  
    13141314    Assert(RTTHREAD_IS_SLEEPING(enmState));
    13151315    PRTTHREADINT pThread = hThread;
    1316     if (hThread && rtThreadGetState(pThread) != RTTHREADSTATE_RUNNING)
     1316    if (hThread && rtThreadGetState(pThread) == RTTHREADSTATE_RUNNING)
    13171317        rtThreadSetState(pThread, enmState);
    13181318}
     
    13351335}
    13361336RT_EXPORT_SYMBOL(RTThreadUnblocked);
     1337
     1338
     1339/**
     1340 * Get the current thread state.
     1341 *
     1342 * @returns The thread state.
     1343 * @param   hThread         The thread.
     1344 */
     1345RTDECL(RTTHREADSTATE) RTThreadGetState(RTTHREAD hThread)
     1346{
     1347    RTTHREADSTATE   enmState = RTTHREADSTATE_INVALID;
     1348    PRTTHREADINT    pThread  = rtThreadGet(hThread);
     1349    if (pThread)
     1350    {
     1351        enmState = rtThreadGetState(pThread);
     1352        rtThreadRelease(pThread);
     1353    }
     1354    return enmState;
     1355}
     1356RT_EXPORT_SYMBOL(RTThreadGetState);
    13371357
    13381358
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