Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
gh-127081: add critical sections todbm
objects#132749
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The dbm_* functions are not thread-safe, naturally. Add critical sections toprotect their use.
dbm
objectsThere 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.
In general, it's easier to addlock_held
variations of functions instead of adding inline critical sections withgoto
. For example:
staticintdbm_something_lock_held(PyObject*self){/* ... */}staticintdbm_something(PyObject*self){intresult;Py_BEGIN_CRITICAL_SECTION(self);result=dbm_something_lock_held(self);Py_END_CRITICAL_SECTION();returnresult;}
Would you mind switching over to that pattern here?
For sure, that would be much more robust, thanks! |
…ctioninstead of using gotos everywhere.
Sorry for the delay, I will review during the PyCon sprint. |
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 as well
Oh it's not relatede to dbms. |
ffaeb3d
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The dbm_* functions are not thread-safe, naturally. Add critical sections to protect their use.