mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-25 14:52:28 +00:00
Upgrade to 2022-era LLVM LIBCXX
This commit is contained in:
parent
2f4ca71f26
commit
8e68384e15
2078 changed files with 165657 additions and 65010 deletions
61
third_party/libcxx/condition_variable
vendored
61
third_party/libcxx/condition_variable
vendored
|
@ -1,5 +1,5 @@
|
|||
// -*- C++ -*-
|
||||
//===---------------------- condition_variable ----------------------------===//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
@ -10,18 +10,6 @@
|
|||
#ifndef _LIBCPP_CONDITION_VARIABLE
|
||||
#define _LIBCPP_CONDITION_VARIABLE
|
||||
|
||||
#include "third_party/libcxx/__config"
|
||||
#include "third_party/libcxx/__mutex_base"
|
||||
#include "third_party/libcxx/memory"
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
/*
|
||||
condition_variable synopsis
|
||||
|
||||
|
@ -118,6 +106,29 @@ public:
|
|||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__chrono/duration.h>
|
||||
#include <__chrono/steady_clock.h>
|
||||
#include <__chrono/time_point.h>
|
||||
#include <__condition_variable/condition_variable.h>
|
||||
#include <__config>
|
||||
#include <__memory/shared_ptr.h>
|
||||
#include <__memory/unique_ptr.h>
|
||||
#include <__mutex/lock_guard.h>
|
||||
#include <__mutex/mutex.h>
|
||||
#include <__mutex/tag_types.h>
|
||||
#include <__mutex/unique_lock.h>
|
||||
#include <__utility/move.h>
|
||||
#include <version>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
class _LIBCPP_TYPE_VIS condition_variable_any
|
||||
{
|
||||
condition_variable __cv_;
|
||||
|
@ -188,7 +199,7 @@ condition_variable_any::notify_all() _NOEXCEPT
|
|||
struct __lock_external
|
||||
{
|
||||
template <class _Lock>
|
||||
void operator()(_Lock* __m) {__m->lock();}
|
||||
_LIBCPP_HIDE_FROM_ABI void operator()(_Lock* __m) {__m->lock();}
|
||||
};
|
||||
|
||||
template <class _Lock>
|
||||
|
@ -199,7 +210,7 @@ condition_variable_any::wait(_Lock& __lock)
|
|||
unique_lock<mutex> __lk(*__mut);
|
||||
__lock.unlock();
|
||||
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
|
||||
lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
|
||||
lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
|
||||
__cv_.wait(__lk);
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
|
@ -221,7 +232,7 @@ condition_variable_any::wait_until(_Lock& __lock,
|
|||
unique_lock<mutex> __lk(*__mut);
|
||||
__lock.unlock();
|
||||
unique_ptr<_Lock, __lock_external> __lxx(&__lock);
|
||||
lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock);
|
||||
lock_guard<unique_lock<mutex> > __lx(__lk, adopt_lock_t());
|
||||
return __cv_.wait_until(__lk, __t);
|
||||
} // __mut_.unlock(), __lock.lock()
|
||||
|
||||
|
@ -259,10 +270,24 @@ condition_variable_any::wait_for(_Lock& __lock,
|
|||
}
|
||||
|
||||
_LIBCPP_FUNC_VIS
|
||||
void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
|
||||
void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // !_LIBCPP_HAS_NO_THREADS
|
||||
|
||||
#endif // _LIBCPP_CONDITION_VARIABLE
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <atomic>
|
||||
# include <concepts>
|
||||
# include <cstdint>
|
||||
# include <cstdlib>
|
||||
# include <cstring>
|
||||
# include <initializer_list>
|
||||
# include <new>
|
||||
# include <stdexcept>
|
||||
# include <system_error>
|
||||
# include <type_traits>
|
||||
# include <typeinfo>
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CONDITION_VARIABLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue