Skip to content

Commit

Permalink
Adding internal threading support for POSIX(OFF)
Browse files Browse the repository at this point in the history
  • Loading branch information
zibi2 committed Feb 3, 2022
1 parent 607ffa5 commit 9ac3e12
Show file tree
Hide file tree
Showing 11 changed files with 516 additions and 14 deletions.
9 changes: 8 additions & 1 deletion libcxx/include/__threading_support
Expand Up @@ -252,7 +252,14 @@ int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
#if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL))

#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
#if defined(_LIBCPP_HAS_THREAD_LIBRARY_OPTIONAL)
// Empty - function definitions are provided by src/include/internal_threading_support.h
#if !defined(_LIBCPP_BUILDING_LIBRARY)
#error _LIBCPP_HAS_THREAD_LIBRARY_OPTIONAL is only intended to protect internal \
uses of __threading_support by libcxx.
#endif

#elif defined(_LIBCPP_HAS_THREAD_API_PTHREAD)

_LIBCPP_HIDE_FROM_ABI inline
int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
Expand Down
1 change: 1 addition & 0 deletions libcxx/src/CMakeLists.txt
Expand Up @@ -18,6 +18,7 @@ set(LIBCXX_SOURCES
include/apple_availability.h
include/atomic_support.h
include/config_elast.h
include/internal_threading_support.h
include/refstring.h
include/ryu/common.h
include/ryu/d2fixed.h
Expand Down
2 changes: 1 addition & 1 deletion libcxx/src/debug.cpp
Expand Up @@ -14,7 +14,7 @@
#include "cstdio"
#include "__hash_table"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
#include "include/internal_threading_support.h"
#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
Expand Down

0 comments on commit 9ac3e12

Please sign in to comment.