VirtualBox

vbox的更動 41881 路徑 trunk/src/VBox/Runtime/r3/posix


忽略:
時間撮記:
2012-6-22 上午10:53:32 (12 年 以前)
作者:
vboxsync
訊息:

IPRT: Name threads on linux when supported.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r41763 r41881  
    4848# include <mach/mach_host.h>
    4949#endif
    50 #if defined(RT_OS_DARWIN) /*|| defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) - later */ \
     50#if defined(RT_OS_DARWIN) /*|| defined(RT_OS_FREEBSD) - later */ || defined(RT_OS_LINUX) \
    5151 || defined(IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP)
    5252# define IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP
     
    9292 */
    9393typedef int (*PFNPTHREADSETNAME)(const char *pszName);
    94 # elif
     94# else
    9595/**
    9696 * The variant of pthread_setname_np most other unix-like systems implement.
     
    256256{
    257257    PRTTHREADINT  pThread = (PRTTHREADINT)pvArgs;
     258    pthread_t     Self    = pthread_self();
     259    Assert((uintptr_t)Self == (RTNATIVETHREAD)Self && (uintptr_t)Self != NIL_RTNATIVETHREAD);
    258260
    259261#if defined(RT_OS_LINUX)
     
    287289#ifdef IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP
    288290    if (g_pfnThreadSetName)
     291# ifdef RT_OS_DARWIN
    289292        g_pfnThreadSetName(pThread->szName);
     293# else
     294        g_pfnThreadSetName(Self, pThread->szName);
     295# endif
    290296#endif
    291297
     
    293299     * Call common main.
    294300     */
    295     pthread_t Self = pthread_self();
    296     Assert((uintptr_t)Self == (RTNATIVETHREAD)Self && (uintptr_t)Self != NIL_RTNATIVETHREAD);
    297301    rc = rtThreadMain(pThread, (uintptr_t)Self, &pThread->szName[0]);
    298302
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette