Changeset 11596
- Timestamp:
- 08/24/08 01:25:03 (3 months ago)
- Files:
-
- trunk/include/iprt/thread.h (modified) (2 diffs)
- trunk/src/VBox/Runtime/common/misc/thread.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/iprt/thread.h
r8645 r11596 33 33 #include <iprt/cdefs.h> 34 34 #include <iprt/types.h> 35 #include <iprt/stdarg.h> 35 36 36 37 #ifdef IN_GC … … 216 217 217 218 /** 219 * Create a new thread. 220 * 221 * Same as RTThreadCreate except the name is given in the RTStrPrintfV form. 222 * 223 * @returns iprt status code. 224 * @param pThread See RTThreadCreate. 225 * @param pfnThread See RTThreadCreate. 226 * @param pvUser See RTThreadCreate. 227 * @param cbStack See RTThreadCreate. 228 * @param enmType See RTThreadCreate. 229 * @param fFlags See RTThreadCreate. 230 * @param pszName Thread name format. 231 * @param va Format arguments. 232 */ 233 RTDECL(int) RTThreadCreateV(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack, 234 RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, va_list va); 235 236 /** 237 * Create a new thread. 238 * 239 * Same as RTThreadCreate except the name is given in the RTStrPrintf form. 240 * 241 * @returns iprt status code. 242 * @param pThread See RTThreadCreate. 243 * @param pfnThread See RTThreadCreate. 244 * @param pvUser See RTThreadCreate. 245 * @param cbStack See RTThreadCreate. 246 * @param enmType See RTThreadCreate. 247 * @param fFlags See RTThreadCreate. 248 * @param pszName Thread name format. 249 * @param ... Format arguments. 250 */ 251 RTDECL(int) RTThreadCreateF(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack, 252 RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, ...); 253 254 /** 218 255 * Gets the native thread id of a IPRT thread. 219 256 * trunk/src/VBox/Runtime/common/misc/thread.cpp
r10795 r11596 114 114 * in thread local storage (TLS). 115 115 * 116 * In Ring-0 we only try keep track of kernel threads created by RT CreateThread116 * In Ring-0 we only try keep track of kernel threads created by RTThreadCreate 117 117 * at the moment. There we really only need the 'join' feature, but doing things 118 118 * the same way allow us to name threads and similar stuff. … … 716 716 LogFlow(("RTThreadCreate: Failed to create thread, rc=%Vrc\n", rc)); 717 717 AssertReleaseRC(rc); 718 return rc; 719 } 720 721 722 /** 723 * Create a new thread. 724 * 725 * Same as RTThreadCreate except the name is given in the RTStrPrintfV form. 726 * 727 * @returns iprt status code. 728 * @param pThread See RTThreadCreate. 729 * @param pfnThread See RTThreadCreate. 730 * @param pvUser See RTThreadCreate. 731 * @param cbStack See RTThreadCreate. 732 * @param enmType See RTThreadCreate. 733 * @param fFlags See RTThreadCreate. 734 * @param pszName Thread name format. 735 * @param va Format arguments. 736 */ 737 RTDECL(int) RTThreadCreateV(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack, 738 RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, va_list va) 739 { 740 char szName[RTTHREAD_NAME_LEN * 2]; 741 RTStrPrintfV(szName, sizeof(szName), pszNameFmt, va); 742 return RTThreadCreate(pThread, pfnThread, pvUser, cbStack, enmType, fFlags, szName); 743 } 744 745 746 /** 747 * Create a new thread. 748 * 749 * Same as RTThreadCreate except the name is given in the RTStrPrintf form. 750 * 751 * @returns iprt status code. 752 * @param pThread See RTThreadCreate. 753 * @param pfnThread See RTThreadCreate. 754 * @param pvUser See RTThreadCreate. 755 * @param cbStack See RTThreadCreate. 756 * @param enmType See RTThreadCreate. 757 * @param fFlags See RTThreadCreate. 758 * @param pszName Thread name format. 759 * @param ... Format arguments. 760 */ 761 RTDECL(int) RTThreadCreateF(PRTTHREAD pThread, PFNRTTHREAD pfnThread, void *pvUser, size_t cbStack, 762 RTTHREADTYPE enmType, uint32_t fFlags, const char *pszNameFmt, ...) 763 { 764 va_list va; 765 va_start(va, pszNameFmt); 766 int rc = RTThreadCreateV(pThread, pfnThread, pvUser, cbStack, enmType, fFlags, pszNameFmt, va); 767 va_end(va); 718 768 return rc; 719 769 }

