-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Deadloop in Windows, os.sleep(-1)
#23732
Comments
BTW, It seems to deadloop as os.sleep calls Sleep on Windows, whose parameter type, is in fact Still a |
What's wrong with |
on posix, it returns immediately. (and set errno to |
And strictly speaking, not forever, but a very large uint amount of time. e.g. Currently on Windows: a.k.a. while |
|
Description
BTW, on POSIX, it just returns immediately, as sleep calls
nanosleep
, which exits with errno set asEINVAL
for negative values.Nim Version
At least from 1.6.14 to 2.1.1 and devel
Current Output
No response
Expected Output
No response
Possible Solution
Two direction:
Additional Information
In Python, time.sleep raises ValueError on negative value.
Maybe we can raises OSError as Nim's sleep is in
std/os
if the first direction is accepted.On the other hand, golang's time.Sleep will return immediately for negative values.
The text was updated successfully, but these errors were encountered: