Ignore:
Timestamp:
Mar 11, 2009, 6:26:55 PM (16 years ago)
Author:
Darin Adler
Message:

2009-03-11 Darin Adler <Darin Adler>

Reviewed by Mark Rowe.

Give threads names on platforms with pthread_setname_np.

  • wtf/Threading.cpp: (WTF::NewThreadContext::NewThreadContext): Initialize thread name. (WTF::threadEntryPoint): Call setThreadNameInternal. (WTF::createThread): Pass thread name.
  • wtf/Threading.h: Added new comments, setThreadNameInternal.
  • wtf/ThreadingGtk.cpp: (WTF::setThreadNameInternal): Added. Empty.
  • wtf/ThreadingNone.cpp: (WTF::setThreadNameInternal): Added. Empty.
  • wtf/ThreadingPthreads.cpp: (WTF::setThreadNameInternal): Call pthread_setname_np when available.
  • wtf/ThreadingQt.cpp: (WTF::setThreadNameInternal): Added. Empty.
  • wtf/ThreadingWin.cpp: (WTF::setThreadNameInternal): Added. Empty.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Threading.h

    r41536 r41605  
    109109typedef void* (*ThreadFunction)(void* argument);
    110110
    111 // Returns 0 if thread creation failed
     111// Returns 0 if thread creation failed.
     112// The thread name must be a literal since on some platforms it's passed in to the thread.
    112113ThreadIdentifier createThread(ThreadFunction, void*, const char* threadName);
     114
     115// Internal platform-specific createThread implementation.
    113116ThreadIdentifier createThreadInternal(ThreadFunction, void*, const char* threadName);
     117
     118// Called in the thread during initialization.
     119// Helpful for platforms where the thread name must be set from within the thread.
     120void setThreadNameInternal(const char* threadName);
    114121
    115122ThreadIdentifier currentThread();
Note: See TracChangeset for help on using the changeset viewer.