VirtualBox

Changeset 1766 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 28, 2007 12:51:24 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19936
Message:

Introduce a dummy thread name parameter to rtThreadMain to allow
identifying the thread from a debugger backtrace.

Location:
trunk/src/VBox/Runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/thread.h

    r403 r1766  
    206206
    207207/* thread.cpp */
    208 int rtThreadMain(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread);
     208int rtThreadMain(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread, const char *pszThreadName);
    209209void rtThreadBlocking(PRTTHREADINT pThread, RTTHREADSTATE enmState, uint64_t u64Block,
    210210                      const char *pszFile, unsigned uLine, RTUINTPTR uId);
  • trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp

    r1201 r1766  
    111111
    112112#ifdef fibGetTidPid
    113     rtThreadMain(pThread, fibGetTidPid());
     113    rtThreadMain(pThread, fibGetTidPid(), &pThread->&szName);
    114114#else
    115     rtThreadMain(pThread, _gettid());
     115    rtThreadMain(pThread, _gettid(), &pThread->&szName);
    116116#endif
    117117
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r537 r1766  
    134134    pthread_t Self = pthread_self();
    135135    Assert((uintptr_t)Self == (RTNATIVETHREAD)Self && (uintptr_t)Self != NIL_RTNATIVETHREAD);
    136     rc = rtThreadMain(pThread, (uintptr_t)Self);
     136    rc = rtThreadMain(pThread, (uintptr_t)Self, &pThread->szName[0]);
    137137
    138138    pthread_setspecific(g_SelfKey, NULL);
  • trunk/src/VBox/Runtime/r3/win32/thread-win32.cpp

    r248 r1766  
    9595        AssertReleaseMsgFailed(("failed to set self TLS. lasterr=%d thread '%s'\n", GetLastError(), pThread->szName));
    9696
    97     int rc = rtThreadMain(pThread, dwThreadId);
     97    int rc = rtThreadMain(pThread, dwThreadId, &pThread->szName[0]);
    9898
    9999    TlsSetValue(g_dwSelfTLS, NULL);
  • trunk/src/VBox/Runtime/thread.cpp

    r1190 r1766  
    568568 * @param   pThread         The thread structure.
    569569 * @param   NativeThread    The native thread id.
    570  */
    571 int rtThreadMain(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread)
    572 {
     570 * @param   pszThreadName   The name of the thread (purely a dummy for backtrace).
     571 */
     572int rtThreadMain(PRTTHREADINT pThread, RTNATIVETHREAD NativeThread, const char *pszThreadName)
     573{
     574    NOREF(pszThreadName);
    573575    rtThreadInsert(pThread, NativeThread);
    574576    Log(("rtThreadMain: Starting: pThread=%p NativeThread=%RTnthrd Name=%s pfnThread=%p pvUser=%p\n",
Note: See TracChangeset for help on using the changeset viewer.

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