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")
9191{
9292 cppcoro::static_thread_pool tp{ 3 };
9393
94- unsigned max_depth = 0 ;
95-
9694 auto run = [&]() -> cppcoro::task<>
9795 {
9896 cppcoro::async_auto_reset_event event;
@@ -105,12 +103,18 @@ TEST_CASE("multi-threaded")
105103 co_await event;
106104 ++value;
107105
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 ; };
110116
111- depth += 1 ;
112117 event.set ();
113- depth -= 1 ;
114118 };
115119
116120 auto startSignaller = [&]() -> cppcoro::task<>
@@ -143,8 +147,6 @@ TEST_CASE("multi-threaded")
143147 }
144148
145149 cppcoro::sync_wait (cppcoro::when_all (std::move (tasks)));
146-
147- CHECK_MESSAGE (max_depth == 0 , " Nested continuations detected" );
148150}
149151
150152TEST_SUITE_END ();
You can’t perform that action at this time.
0 commit comments