Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0fb4ad718e17916ddeb64917bf7893e603fef28e
      
https://github.com/WebKit/WebKit/commit/0fb4ad718e17916ddeb64917bf7893e603fef28e
  Author: Carlos Garcia Campos <[email protected]>
  Date:   2026-07-21 (Tue, 21 Jul 2026)

  Changed paths:
    M Source/WTF/wtf/Threading.cpp
    M Source/WTF/wtf/posix/ThreadingPOSIX.cpp

  Log Message:
  -----------
  [Linux] Detect if current thread is the main thread and ensure id is always 1
https://bugs.webkit.org/show_bug.cgi?id=319887

Reviewed by Adrian Perez de Castro.

MainThread is lazy initialized and it usually happens before any other
thread is created. If another thread is created before
WTF::initializeMainThread() asserts because the main thread id is not 1
as expected. In linux we can detect the main thread by comparing the
process id with the thread id that is always the same for the main
thread.

* Source/WTF/wtf/Threading.cpp:
* Source/WTF/wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::initializeCurrentTLS):

Canonical link: https://commits.webkit.org/317619@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to