基于C++ Coroutines提案 ‘Stackless Resumable Functions’编写的协程库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *Copyright 2017~2020 lanzhengpeng
  3. *
  4. *Licensed under the Apache License, Version 2.0 (the "License");
  5. *you may not use this file except in compliance with the License.
  6. *You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. *Unless required by applicable law or agreed to in writing, software
  11. *distributed under the License is distributed on an "AS IS" BASIS,
  12. *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. *See the License for the specific language governing permissions and
  14. *limitations under the License.
  15. */
  16. #pragma once
  17. #include <type_traits>
  18. #include <atomic>
  19. #include <chrono>
  20. #include <array>
  21. #include <vector>
  22. #include <deque>
  23. #include <mutex>
  24. #include <map>
  25. #include <list>
  26. #include <any>
  27. #include <unordered_map>
  28. #include <functional>
  29. #include <optional>
  30. #include <thread>
  31. #include <iostream>
  32. #include <assert.h>
  33. #if defined(__clang__) && _WIN32
  34. #include "src/unix/coroutine.h" //编译器内建的协程函数,MSVC和clang不一样
  35. #else
  36. #include <experimental/coroutine>
  37. #endif
  38. #include "src/def.h"
  39. #include "src/macro_def.inl"
  40. #include "src/counted_ptr.h"
  41. #include "src/type_traits.inl"
  42. #include "src/type_concept.inl"
  43. #include "src/spinlock.h"
  44. #include "src/state.h"
  45. #include "src/future.h"
  46. #include "src/promise.h"
  47. #include "src/awaitable.h"
  48. #include "src/generator.h"
  49. #include "src/rf_task.h"
  50. #include "src/timer.h"
  51. #include "src/scheduler.h"
  52. #include "src/promise.inl"
  53. #include "src/state.inl"
  54. #include "src/switch_scheduler.h"
  55. #include "src/current_scheduler.h"
  56. #include "src/yield.h"
  57. #include "src/sleep.h"
  58. #include "src/when.h"
  59. #include "src/_awaker.h"
  60. #include "src/ring_queue.h"
  61. #include "src/intrusive_link_queue.h"
  62. #include "src/channel.h"
  63. #include "src/event.h"
  64. #include "src/mutex.h"