-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support interrupt transaction #993
Conversation
expired = 1; | ||
call_expiration_callback(); | ||
} | ||
|
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.
Feels like this may introduce a possibility of the expiration callback being called twice? I am not sure how much that matters. Do we need to test_and_set both here and in the normal expiry path to guard against that?
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.
I was under the impression that it didn't matter to be called twice. Not sure how to exactly verify that. Maybe safest to do the test_and_set.
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.
Done.
Note:start |
|
||
void platform_timer::expire_now() { | ||
bool expected = false; | ||
if (expired.compare_exchange_strong(expected, true)) { |
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.
I guess you can save a line of code using atomic_flag, but it doesn't really matter
Support interrupt transaction |
Add support for interrupting a transaction in
apply_block
viactrl-c
orSIGINT/SIGTERM/SIGPIPE
.Requires AntelopeIO/appbase#36
Resolves #985
Resolves #876