bpo-30766: Make CHECK_STATUS_PTHREAD signal-safe.#2404
bpo-30766: Make CHECK_STATUS_PTHREAD signal-safe.#2404pitrou wants to merge 1 commit intopython:masterpython/cpython:masterfrom pitrou:signal_safe_check_status_pthreadpitrou/cpython:signal_safe_check_status_pthreadCopy head branch name to clipboard
Conversation
| pthread_mutex_t mut; | ||
| } pthread_lock; | ||
|
|
||
| #define PUTS(fd, str) _Py_write_noraise(fd, str, (int)strlen(str)) |
There was a problem hiding this comment.
I don't know, I copied this macro from traceback.c.
| #define CHECK_STATUS_PTHREAD(name) if (status != 0) { fprintf(stderr, \ | ||
| "%s: %s\n", name, strerror(status)); error = 1; } | ||
| /* CHECK_STATUS_PTHREAD is async-signal-safe */ | ||
| #define CHECK_STATUS_PTHREAD(name) \ |
There was a problem hiding this comment.
I never understood the purpose of these functions. Do we really need these checks? Why not replacing them with an assertion?
If you want to get them at runtime, maybe call Py_FatalError()?
There was a problem hiding this comment.
I don't know. I'm inclined not to remove them right now.
OTOH, this whole PR may be made obsolete by #2408.
There was a problem hiding this comment.
I don't know. I'm inclined not to remove them right now. OTOH, this whole PR may be made obsolete by #2408.
Oh no, please finish your work. I like the idea of more reliable locks :-)
|
I'm inclined to reject this PR. Locks are not signal-safe, so it doesn't make sense to fix a tiny bit of code inside them. |
No description provided.