-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gate: add named_gate #2688
base: master
Are you sure you want to change the base?
gate: add named_gate #2688
Conversation
Intended use case: scylladb/scylladb#23329 |
Same problem for semaphores is solved with the help of "named" exception factory (59a6a47). It's worth making gates and semaphores symmetrical in this sense |
In v2 (380d057):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but
- "gate: add named_gate" patch comment should be updated (patch title should probably be updated too)
- CI shows compilation failures
Signed-off-by: Benny Halevy <[email protected]>
Prepare for adding named_gate using a named gate_closed_exception_factory. Signed-off-by: Benny Halevy <[email protected]>
By specializing basic_gate using named_gate_exception_factory. And add respective unit test. Signed-off-by: Benny Halevy <[email protected]>
In v3 (7c31e6f):
|
FWIW, the strong named_gate type causes a lot of churn since it is not derived from |
@xemul please see alternative design here: bhalevy@4907d7d |
If this whole churn is isolated in gate.hh, I'd still go this way, it looks more solid and self-contained to me |
No, it requires to change current user code that use gate::holder to be modified to named_gate::holder, since named_gate is strongly distinguishable from gate. |
Allow specifying a name for the gate when created using a named exception factory,
to help debugging gate_closed_exception.