File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,6 @@ TEST_CASE("multi-threaded")
91
91
{
92
92
cppcoro::static_thread_pool tp{ 3 };
93
93
94
- unsigned max_depth = 0 ;
95
-
96
94
auto run = [&]() -> cppcoro::task<>
97
95
{
98
96
cppcoro::async_auto_reset_event event;
@@ -105,12 +103,18 @@ TEST_CASE("multi-threaded")
105
103
co_await event;
106
104
++value;
107
105
108
- thread_local unsigned depth = 0 ;
109
- if (depth > max_depth) max_depth = depth;
106
+ thread_local volatile bool nested = false ;
107
+
108
+ if (nested)
109
+ {
110
+ co_await tp.schedule ();
111
+ assert (!nested);
112
+ }
113
+
114
+ nested = true ;
115
+ cppcoro::scoped_lambda cleanup = [] { nested = false ; };
110
116
111
- depth += 1 ;
112
117
event.set ();
113
- depth -= 1 ;
114
118
};
115
119
116
120
auto startSignaller = [&]() -> cppcoro::task<>
@@ -143,8 +147,6 @@ TEST_CASE("multi-threaded")
143
147
}
144
148
145
149
cppcoro::sync_wait (cppcoro::when_all (std::move (tasks)));
146
-
147
- CHECK_MESSAGE (max_depth == 0 , " Nested continuations detected" );
148
150
}
149
151
150
152
TEST_SUITE_END ();
You can’t perform that action at this time.
0 commit comments