stop_token 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifndef _LIBCPP_STOP_TOKEN
  10. #define _LIBCPP_STOP_TOKEN
  11. /*
  12. namespace std {
  13. // [stoptoken], class stop_token
  14. class stop_token;
  15. // [stopsource], class stop_source
  16. class stop_source;
  17. // no-shared-stop-state indicator
  18. struct nostopstate_t {
  19. explicit nostopstate_t() = default;
  20. };
  21. inline constexpr nostopstate_t nostopstate{};
  22. // [stopcallback], class template stop_callback
  23. template<class Callback>
  24. class stop_callback;
  25. */
  26. #include <__config>
  27. #ifdef _LIBCPP_HAS_NO_THREADS
  28. # error "<stop_token> is not supported since libc++ has been configured without support for threads."
  29. #endif
  30. #include <__stop_token/stop_callback.h>
  31. #include <__stop_token/stop_source.h>
  32. #include <__stop_token/stop_token.h>
  33. #include <version>
  34. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  35. # pragma GCC system_header
  36. #endif
  37. #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
  38. # include <iosfwd>
  39. #endif
  40. #endif // _LIBCPP_STOP_TOKEN