xref: /freebsd/contrib/llvm-project/libcxx/include/stop_token (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
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>
357a6dacacSDimitry Andric
36*0fca6ea1SDimitry Andric#if !defined(_LIBCPP_HAS_NO_THREADS)
377a6dacacSDimitry Andric
38*0fca6ea1SDimitry Andric#  if _LIBCPP_STD_VER >= 20
3906c3fb27SDimitry Andric#    include <__stop_token/stop_callback.h>
4006c3fb27SDimitry Andric#    include <__stop_token/stop_source.h>
4106c3fb27SDimitry Andric#    include <__stop_token/stop_token.h>
42*0fca6ea1SDimitry Andric#  endif
43*0fca6ea1SDimitry Andric
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
50*0fca6ea1SDimitry Andric#endif // !defined(_LIBCPP_HAS_NO_THREADS)
51*0fca6ea1SDimitry Andric
525f757f3fSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
535f757f3fSDimitry Andric#  include <iosfwd>
545f757f3fSDimitry Andric#endif
555f757f3fSDimitry Andric
5606c3fb27SDimitry Andric#endif // _LIBCPP_STOP_TOKEN
57