Assert parking lots have no suspended waiters at destruction#25
Merged
dprokoptsev merged 1 commit intoJun 10, 2026
Merged
Conversation
Signed-off-by: Jeet Dekivadia <jeet.university@gmail.com>
Contributor
Author
|
Small follow-up for review context. This extends the existing Channel lifetime defense to the shared parking-lot base used by Event, Semaphore, and ParkingLot. Destroying a lot while a coroutine is still parked otherwise leaves an intrusive waiter behind; asserting at destruction makes that misuse deterministic at the ownership boundary. Validation from preparation: git diff --check; clang++ -std=c++20 -fsyntax-only probe including corral/corral.h and constructing Event, Semaphore, and ParkingLot; GCC 14 configure, build, and CTest; and a focused harness that exited 0 for empty destruction and reached the custom CORRAL_ASSERT path with exit 42 for one parked waiter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParkingLotImplis empty before its intrusive wait queue is destroyedChanneltoEvent,Semaphore, andParkingLotValidation
git diff --checkprintf '#include "corral/corral.h"\\nint main() { corral::Event e; corral::Semaphore s; corral::ParkingLot p; }\\n' | clang++ -std=c++20 -fsyntax-only -I. -x c++ -cmake -S . -B build -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 -DCORRAL_BOOST=/opt/include -DCORRAL_CATCH2=https://github.com/catchorg/catch2cmake --build build -j2ctest --test-dir build --output-on-failure0; destruction with one parked waiter reached the customCORRAL_ASSERThandler with exit42