VirtualBox

Changeset 71127 in vbox


Ignore:
Timestamp:
Feb 26, 2018 3:21:36 PM (7 years ago)
Author:
vboxsync
Message:

IPRT: Added RTThreadGetNativeHandle for windows.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r70895 r71127  
    22182218# define RTThreadGetName                                RT_MANGLER(RTThreadGetName)
    22192219# define RTThreadGetNative                              RT_MANGLER(RTThreadGetNative)
     2220# define RTThreadGetNativeHandle                        RT_MANGLER(RTThreadGetNativeHandle)
    22202221# define RTThreadGetNativeState                         RT_MANGLER(RTThreadGetNativeState)
    22212222# define RTThreadGetReallySleeping                      RT_MANGLER(RTThreadGetReallySleeping)
  • trunk/include/iprt/thread.h

    r69105 r71127  
    326326 */
    327327RTDECL(RTNATIVETHREAD) RTThreadGetNative(RTTHREAD Thread);
     328
     329/**
     330 * Gets the native thread handle for a IPRT thread.
     331 *
     332 * @returns The thread handle. INVALID_HANDLE_VALUE on failure.
     333 * @param   hThread     The IPRT thread handle.
     334 *
     335 * @note    Windows only.
     336 * @note    Only valid after parent returns from the thread creation call.
     337 */
     338RTDECL(uintptr_t) RTThreadGetNativeHandle(RTTHREAD hThread);
    328339
    329340/**
  • trunk/src/VBox/Runtime/r3/win/thread-win.cpp

    r69111 r71127  
    377377}
    378378
     379
     380/**
     381 * Gets the native thread handle for a IPRT thread.
     382 *
     383 * @returns The thread handle. INVALID_HANDLE_VALUE on failure.
     384 * @param   hThread     The IPRT thread handle.
     385 *
     386 * @note    Windows only.
     387 * @note    Only valid after parent returns from the thread creation call.
     388 */
     389RTDECL(uintptr_t) RTThreadGetNativeHandle(RTTHREAD hThread)
     390{
     391    PRTTHREADINT pThread = rtThreadGet(hThread);
     392    if (pThread)
     393    {
     394        uintptr_t hHandle = pThread->hThread;
     395        rtThreadRelease(pThread);
     396        return hHandle;
     397    }
     398    return (uintptr_t)INVALID_HANDLE_VALUE;
     399}
     400RT_EXPORT_SYMBOL(RTThreadGetNativeHandle);
     401
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