Fix chromium build (libcxxabi)

Pull the dependency on pthread_mach_thread_np() back into libcxxabi.

llvm-svn: 293166
This commit is contained in:
Asiri Rathnayake 2017-01-26 10:38:03 +00:00
parent 64bbb1357f
commit 085b612c31
1 changed files with 13 additions and 1 deletions

View File

@ -179,7 +179,19 @@ _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
if (result)
{
#if defined(__APPLE__) && !defined(__arm__)
const lock_type id = std::__libcpp_thread_get_port();
// This is a special-case pthread dependency for Mac. We can't pull this
// out into libcxx's threading API (__threading_support) because not all
// supported Mac environments provide this function (in pthread.h). To
// make it possible to build/use libcxx in those environments, we have to
// keep this pthread dependency local to libcxxabi. If there is some
// convenient way to detect precisely when pthread_mach_thread_np is
// available in a given Mac environment, it might still be possible to
// bury this dependency in __threading_support.
#ifdef _LIBCPP_HAS_THREAD_API_PTHREAD
const lock_type id = pthread_mach_thread_np(std::__libcpp_thread_get_current_id());
#else
#error "How do I pthread_mach_thread_np()?"
#endif
lock_type lock = get_lock(*guard_object);
if (lock)
{