stop_token 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <__assert> // all public C++ headers provide the assertion handler
  27. #include <__config>
  28. #include <__stop_token/stop_callback.h>
  29. #include <__stop_token/stop_source.h>
  30. #include <__stop_token/stop_token.h>
  31. #include <version>
  32. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  33. # pragma GCC system_header
  34. #endif
  35. #ifdef _LIBCPP_HAS_NO_THREADS
  36. # error "<stop_token> is not supported since libc++ has been configured without support for threads."
  37. #endif
  38. #endif // _LIBCPP_STOP_TOKEN