1// -*- C++ -*- 2//===----------------------------------------------------------------------===// 3// 4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5// See https://llvm.org/LICENSE.txt for license information. 6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef _LIBCPP_STOP_TOKEN 11#define _LIBCPP_STOP_TOKEN 12 13/* 14 15namespace std { 16 // [stoptoken], class stop_token 17 class stop_token; 18 19 // [stopsource], class stop_source 20 class stop_source; 21 22 // no-shared-stop-state indicator 23 struct nostopstate_t { 24 explicit nostopstate_t() = default; 25 }; 26 inline constexpr nostopstate_t nostopstate{}; 27 28 // [stopcallback], class template stop_callback 29 template<class Callback> 30 class stop_callback; 31 32*/ 33 34#include <__assert> // all public C++ headers provide the assertion handler 35#include <__config> 36#include <__stop_token/stop_callback.h> 37#include <__stop_token/stop_source.h> 38#include <__stop_token/stop_token.h> 39#include <version> 40 41#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 42# pragma GCC system_header 43#endif 44 45#ifdef _LIBCPP_HAS_NO_THREADS 46# error "<stop_token> is not supported since libc++ has been configured without support for threads." 47#endif 48 49#endif // _LIBCPP_STOP_TOKEN 50