vbox的更動 41763 路徑 trunk/src/VBox/Runtime/r3/posix
- 時間撮記:
- 2012-6-15 下午05:35:41 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r37733 r41763 48 48 # include <mach/mach_host.h> 49 49 #endif 50 #if defined(RT_OS_DARWIN) /*|| defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) - later */ \ 51 || defined(IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP) 52 # define IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP 53 # include <dlfcn.h> 54 #endif 50 55 51 56 #include <iprt/thread.h> … … 77 82 static int g_iSigPokeThread = -1; 78 83 #endif 84 85 #ifdef IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP 86 # if defined(RT_OS_DARWIN) 87 /** 88 * The Mac OS X (10.6 and later) variant of pthread_setname_np. 89 * 90 * @returns errno.h 91 * @param pszName The new thread name. 92 */ 93 typedef int (*PFNPTHREADSETNAME)(const char *pszName); 94 # elif 95 /** 96 * The variant of pthread_setname_np most other unix-like systems implement. 97 * 98 * @returns errno.h 99 * @param hThread The thread. 100 * @param pszName The new thread name. 101 */ 102 typedef int (*PFNPTHREADSETNAME)(pthread_t hThread, const char *pszName); 103 # endif 104 105 /** Pointer to pthread_setname_np if found. */ 106 static PFNPTHREADSETNAME g_pfnThreadSetName = NULL; 107 #endif /* IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP */ 79 108 80 109 … … 143 172 } 144 173 #endif /* RTTHREAD_POSIX_WITH_POKE */ 174 175 #ifdef IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP 176 if (RT_SUCCESS(rc)) 177 g_pfnThreadSetName = (PFNPTHREADSETNAME)(uintptr_t)dlsym(RTLD_DEFAULT, "pthread_setname_np"); 178 #endif 145 179 return rc; 146 180 } … … 245 279 #endif 246 280 281 /* 282 * Set the TLS entry and, if possible, the thread name. 283 */ 247 284 int rc = pthread_setspecific(g_SelfKey, pThread); 248 285 AssertReleaseMsg(!rc, ("failed to set self TLS. rc=%d thread '%s'\n", rc, pThread->szName)); 286 287 #ifdef IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP 288 if (g_pfnThreadSetName) 289 g_pfnThreadSetName(pThread->szName); 290 #endif 249 291 250 292 /*
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器