diff options
author | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-16 20:19:28 +0300 |
---|---|---|
committer | ilnurkh <ilnurkh@yandex-team.com> | 2023-10-16 20:52:22 +0300 |
commit | 23b4cd86157da8b9f0f8acd5ef46acfab39669db (patch) | |
tree | 09572627315c6029e0434702e8330c557476ff06 /library/cpp/actors/cppcoro | |
parent | 05d934cd8bfcf7ce4b6241d6bd2914cc776877f9 (diff) | |
download | ydb-23b4cd86157da8b9f0f8acd5ef46acfab39669db.tar.gz |
Y_VERIFY_DEBUG->Y_DEBUG_ABORT_UNLESS at '-v ydb'
https://clubs.at.yandex-team.ru/arcadia/29404
Diffstat (limited to 'library/cpp/actors/cppcoro')
-rw-r--r-- | library/cpp/actors/cppcoro/task.h | 14 | ||||
-rw-r--r-- | library/cpp/actors/cppcoro/task_group.h | 4 | ||||
-rw-r--r-- | library/cpp/actors/cppcoro/task_result.h | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/actors/cppcoro/task.h b/library/cpp/actors/cppcoro/task.h index ad665d4cbf..8afeb7e705 100644 --- a/library/cpp/actors/cppcoro/task.h +++ b/library/cpp/actors/cppcoro/task.h @@ -33,7 +33,7 @@ namespace NActors { explicit TTaskAwaiter(TTaskHandle<T> handle) : Handle(handle) { - Y_VERIFY_DEBUG(Handle); + Y_DEBUG_ABORT_UNLESS(Handle); } TTaskAwaiter(TTaskAwaiter&& rhs) @@ -54,13 +54,13 @@ namespace NActors { // Some arbitrary continuation c suspended and awaits the task TTaskHandle<T> await_suspend(std::coroutine_handle<> c) noexcept { - Y_VERIFY_DEBUG(Handle); + Y_DEBUG_ABORT_UNLESS(Handle); Handle.promise().SetContinuation(c); return Handle; } TTaskResult<T>&& await_resume() noexcept { - Y_VERIFY_DEBUG(Handle); + Y_DEBUG_ABORT_UNLESS(Handle); return std::move(Handle.promise().Result); } @@ -133,7 +133,7 @@ namespace NActors { static std::coroutine_handle<> await_suspend(std::coroutine_handle<TTaskPromise<T>> h) noexcept { auto next = std::exchange(h.promise().Continuation, std::noop_coroutine()); - Y_VERIFY_DEBUG(next, "Task finished without a continuation"); + Y_DEBUG_ABORT_UNLESS(next, "Task finished without a continuation"); return next; } }; @@ -142,7 +142,7 @@ namespace NActors { private: void SetContinuation(std::coroutine_handle<> continuation) noexcept { - Y_VERIFY_DEBUG(!Continuation, "Task can only be awaited once"); + Y_DEBUG_ABORT_UNLESS(!Continuation, "Task can only be awaited once"); Continuation = continuation; } @@ -200,7 +200,7 @@ namespace NActors { * Starts task and returns TTaskResult<T> when it completes */ auto WhenDone() && noexcept { - Y_VERIFY_DEBUG(Handle, "Cannot await an empty task"); + Y_DEBUG_ABORT_UNLESS(Handle, "Cannot await an empty task"); return NDetail::TTaskAwaiter<T>(std::exchange(Handle, {})); } @@ -208,7 +208,7 @@ namespace NActors { * Starts task and returns its result when it completes */ auto operator co_await() && noexcept { - Y_VERIFY_DEBUG(Handle, "Cannot await an empty task"); + Y_DEBUG_ABORT_UNLESS(Handle, "Cannot await an empty task"); return NDetail::TTaskResultAwaiter<T>(std::exchange(Handle, {})); } diff --git a/library/cpp/actors/cppcoro/task_group.h b/library/cpp/actors/cppcoro/task_group.h index 0f7a91262b..5b82e5f592 100644 --- a/library/cpp/actors/cppcoro/task_group.h +++ b/library/cpp/actors/cppcoro/task_group.h @@ -41,7 +41,7 @@ namespace NActors { continue; } // We consume the awaiter - Y_VERIFY_DEBUG(ReadyQueue == nullptr, "TaskGroup is awaiting with non-empty ready queue"); + Y_DEBUG_ABORT_UNLESS(ReadyQueue == nullptr, "TaskGroup is awaiting with non-empty ready queue"); result->Next = ReadyQueue; ReadyQueue = result.release(); return std::exchange(Continuation, {}); @@ -66,7 +66,7 @@ namespace NActors { } Y_NO_INLINE std::coroutine_handle<> Suspend(std::coroutine_handle<> h) noexcept { - Y_VERIFY_DEBUG(ReadyQueue == nullptr, "Caller suspending with non-empty ready queue"); + Y_DEBUG_ABORT_UNLESS(ReadyQueue == nullptr, "Caller suspending with non-empty ready queue"); Continuation = h; void* currentValue = LastReady.load(std::memory_order_acquire); for (;;) { diff --git a/library/cpp/actors/cppcoro/task_result.h b/library/cpp/actors/cppcoro/task_result.h index 70176e64d5..54e66fd57f 100644 --- a/library/cpp/actors/cppcoro/task_result.h +++ b/library/cpp/actors/cppcoro/task_result.h @@ -78,7 +78,7 @@ namespace NActors { } case 2: { std::exception_ptr& e = std::get<2>(Result); - Y_VERIFY_DEBUG(e, "Task exception missing"); + Y_DEBUG_ABORT_UNLESS(e, "Task exception missing"); std::rethrow_exception(e); } } @@ -99,7 +99,7 @@ namespace NActors { } case 2: { std::exception_ptr& e = std::get<2>(Result); - Y_VERIFY_DEBUG(e, "Task exception missing"); + Y_DEBUG_ABORT_UNLESS(e, "Task exception missing"); std::rethrow_exception(std::move(e)); } } |