[all-commits] [llvm/llvm-project] 7162fd: [libc++] Split the monolithic __threading_support ...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Jan 30 05:35:27 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7162fd750ee5f786f3b9b7a7b26b72ee36ce772e
      https://github.com/llvm/llvm-project/commit/7162fd750ee5f786f3b9b7a7b26b72ee36ce772e
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-01-30 (Tue, 30 Jan 2024)

  Changed paths:
    M libcxx/docs/DesignDocs/ThreadingSupportAPI.rst
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__atomic/atomic_flag.h
    M libcxx/include/__atomic/atomic_sync.h
    M libcxx/include/__condition_variable/condition_variable.h
    M libcxx/include/__mutex/mutex.h
    M libcxx/include/__thread/formatter.h
    M libcxx/include/__thread/id.h
    M libcxx/include/__thread/jthread.h
    A libcxx/include/__thread/support.h
    A libcxx/include/__thread/support/c11.h
    A libcxx/include/__thread/support/external.h
    A libcxx/include/__thread/support/pthread.h
    A libcxx/include/__thread/support/windows.h
    M libcxx/include/__thread/this_thread.h
    M libcxx/include/__thread/thread.h
    M libcxx/include/__thread/timed_backoff_policy.h
    R libcxx/include/__threading_support
    M libcxx/include/libcxx.imp
    M libcxx/include/module.modulemap.in
    M libcxx/include/mutex
    M libcxx/include/semaphore
    M libcxx/include/thread
    M libcxx/src/call_once.cpp
    M libcxx/src/condition_variable_destructor.cpp
    M libcxx/src/mutex_destructor.cpp
    M libcxx/src/support/win32/thread_win32.cpp
    M libcxx/utils/generate_iwyu_mapping.py
    M libcxx/utils/libcxx/test/modules.py
    M libcxxabi/src/cxa_exception_storage.cpp
    M libcxxabi/src/cxa_guard_impl.h
    M libcxxabi/src/cxa_thread_atexit.cpp
    M libcxxabi/src/fallback_malloc.cpp
    M libcxxabi/test/test_fallback_malloc.pass.cpp

  Log Message:
  -----------
  [libc++] Split the monolithic __threading_support header (#79654)

The <__threading_support> header is a huge beast and it's really
difficult to navigate. I find myself struggling to find what I want
every time I have to open it, and I've been considering splitting it up
for years for that reason.

This patch aims not to contain any functional change. The various
implementations of the threading base are simply moved to separate
headers and then the individual headers are simplified in mechanical
ways. For example, we used to have redundant declarations of all the
functions at the top of `__threading_support`, and those are removed
since they are not needed anymore. The various #ifdefs are also
simplified and removed when they become unnecessary.

Finally, this patch adds documentation for the API we expect from any
threading implementation.




More information about the All-commits mailing list