brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · f6ffe33 Raw
41 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// Define ~condition_variable.10//11// On some platforms ~condition_variable has been made trivial and the12// definition is only provided for ABI compatibility.13 14#include <__config>15#include <__thread/support.h>16 17#if _LIBCPP_ABI_VERSION == 1 || !_LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION18#  define NEEDS_CONDVAR_DESTRUCTOR19#endif20 21_LIBCPP_BEGIN_NAMESPACE_STD22 23#ifdef NEEDS_CONDVAR_DESTRUCTOR24 25class _LIBCPP_EXPORTED_FROM_ABI condition_variable {26  __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;27 28public:29  _LIBCPP_HIDE_FROM_ABI constexpr condition_variable() noexcept = default;30 31  ~condition_variable();32 33  condition_variable(const condition_variable&)            = delete;34  condition_variable& operator=(const condition_variable&) = delete;35};36 37condition_variable::~condition_variable() { __libcpp_condvar_destroy(&__cv_); }38#endif39 40_LIBCPP_END_NAMESPACE_STD41