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