[Webkit-unassigned] [Bug 25138] New: Need to change WTF::isMainThread() for pthreads to work correctly for thread-specific destructors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 10 16:32:52 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25138

           Summary: Need to change WTF::isMainThread() for pthreads to work
                    correctly for thread-specific destructors
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dimich at chromium.org
                CC: ap at webkit.org, aroben at apple.com


Pthreads run destructors of thread-specific data  after thread exits from its
thread proc. On non-DARWIN or CHROMIUM flavors of pthreads-based ports, this
causes the ThreadIdentifier to be removed from the WTF ThreadMap before those
destructors are run. Because of this, the check in isMainThread():
return currentThread() == mainThreadIdentifier;
will insert the new ThreadIdentifier for the exiting thread which will not be
removed from the map and cause asserts later in
establishIdentifierForPthreadHandle when a new thread with the same thread ID
will be created (pthreads reuse their ids).

Fixed with replacing the check with
return pthread_equal(pthread_self(), mainThreadPthreadID);

Since other platform use other methods of dealing with TLS, this is
pthread-only fix.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list