xref: /freebsd/contrib/llvm-project/libcxx/include/stop_token (revision 7a6dacaca14b62ca4b74406814becb87a3fefac0)
106c3fb27SDimitry Andric// -*- C++ -*-
206c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
306c3fb27SDimitry Andric//
406c3fb27SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
506c3fb27SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
606c3fb27SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
706c3fb27SDimitry Andric//
806c3fb27SDimitry Andric//===----------------------------------------------------------------------===//
906c3fb27SDimitry Andric
1006c3fb27SDimitry Andric#ifndef _LIBCPP_STOP_TOKEN
1106c3fb27SDimitry Andric#define _LIBCPP_STOP_TOKEN
1206c3fb27SDimitry Andric
1306c3fb27SDimitry Andric/*
1406c3fb27SDimitry Andric
1506c3fb27SDimitry Andricnamespace std {
1606c3fb27SDimitry Andric  // [stoptoken], class stop_token
1706c3fb27SDimitry Andric  class stop_token;
1806c3fb27SDimitry Andric
1906c3fb27SDimitry Andric  // [stopsource], class stop_source
2006c3fb27SDimitry Andric  class stop_source;
2106c3fb27SDimitry Andric
2206c3fb27SDimitry Andric  // no-shared-stop-state indicator
2306c3fb27SDimitry Andric  struct nostopstate_t {
2406c3fb27SDimitry Andric    explicit nostopstate_t() = default;
2506c3fb27SDimitry Andric  };
2606c3fb27SDimitry Andric  inline constexpr nostopstate_t nostopstate{};
2706c3fb27SDimitry Andric
2806c3fb27SDimitry Andric  // [stopcallback], class template stop_callback
2906c3fb27SDimitry Andric  template<class Callback>
3006c3fb27SDimitry Andric    class stop_callback;
3106c3fb27SDimitry Andric
3206c3fb27SDimitry Andric*/
3306c3fb27SDimitry Andric
3406c3fb27SDimitry Andric#include <__config>
35*7a6dacacSDimitry Andric
36*7a6dacacSDimitry Andric#ifdef _LIBCPP_HAS_NO_THREADS
37*7a6dacacSDimitry Andric#  error "<stop_token> is not supported since libc++ has been configured without support for threads."
38*7a6dacacSDimitry Andric#endif
39*7a6dacacSDimitry Andric
40*7a6dacacSDimitry Andric#include <__assert> // all public C++ headers provide the assertion handler
4106c3fb27SDimitry Andric#include <__stop_token/stop_callback.h>
4206c3fb27SDimitry Andric#include <__stop_token/stop_source.h>
4306c3fb27SDimitry Andric#include <__stop_token/stop_token.h>
4406c3fb27SDimitry Andric#include <version>
4506c3fb27SDimitry Andric
4606c3fb27SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
4706c3fb27SDimitry Andric#  pragma GCC system_header
4806c3fb27SDimitry Andric#endif
4906c3fb27SDimitry Andric
505f757f3fSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
515f757f3fSDimitry Andric#  include <iosfwd>
525f757f3fSDimitry Andric#endif
535f757f3fSDimitry Andric
5406c3fb27SDimitry Andric#endif // _LIBCPP_STOP_TOKEN
55