Uh oh!
There was an error while loading. Please reload this page.
bpo-21302: Add nanosleep() implementation for time.sleep() in Unix - #28526
bpo-21302: Add nanosleep() implementation for time.sleep() in Unix#28526Livius90 wants to merge 5 commits into
Conversation
Replace outdated select() to use nanosleep() for sleep implementation in Unix
vstinner
left a comment
There was a problem hiding this comment.
I would prefer to restrict this PR to using nanosleep() in time.sleep(), and nothing else. IMO it's already complex enough :-)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| do { | ||
| #ifndef HAVE_CLOCK_NANOSLEEP | ||
| #if defined(HAVE_NANOSLEEP) && !defined(HAVE_CLOCK_NANOSLEEP) |
There was a problem hiding this comment.
The change LGTM, but I propose to write the #ifdef dance differently and rename secs to timeout to make the code more readable. I created PR #28545 based on your PR. Is it better? For the main code in Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, I merged the 3 code paths to put if #ifdef in the Py_BEGIN_ALLOW_THREADS block. What do you think?
vstinner
commented
Sep 25, 2021
I merged PR #28545. |
Some previous pull request history can be found here: #28111, #28341, #28483
https://bugs.python.org/issue21302