Skip to content

Commit

Permalink
remove extra frame in BatchSemaphore::co_wait
Browse files Browse the repository at this point in the history
Summary: cancelled throws through this frame even if the caller uses `co_awaitTry` (adds noticeable overhead).

Reviewed By: ispeters

Differential Revision: D68447822

fbshipit-source-id: 4877e72a41e4dba9ad39f98db8f828f11b650490
  • Loading branch information
Nick Brekhus authored and facebook-github-bot committed Jan 23, 2025
1 parent 04ef10b commit 22b1d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion third-party/folly/src/folly/fibers/BatchSemaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool BatchSemaphore::try_wait(int64_t tokens) {
#if FOLLY_HAS_COROUTINES

coro::Task<void> BatchSemaphore::co_wait(int64_t tokens) {
co_await co_wait_common(tokens);
return co_wait_common(tokens);
}

#endif
Expand Down

0 comments on commit 22b1d69

Please sign in to comment.