-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(gstd): Introduce max ownership time for Mutex #2912
Conversation
Re-review @breathx ? |
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'm considering about providing a handbook for program developers since we are introducing more and more features now, the Learn Gear "std" library
redirects to https://docs.gear.rs/gstd/ (plus https://wiki.gear-tech.io/docs/getting-started-in-5-minutes/) are obvious not friendly enough for new developers
@clearloop please re-review |
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!
This is an idea of supporting max ownership time for Mutex (the same will be implemented for RwLock if everyone happy with this approach). Basically, before acquiring the mutex ownership, one can declare in the code max number of blocks they are going to own the mutex for. If there happens another attempt to grab the same mutex after the specified number of blocks, but the mutex has not been released by the first owner yet, the first message execution will get terminated via panic indicating the message exceeded lock ownership time.
@reviewer-or-team