-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Location
std::thread::sleep
Summary
POSIX permits the C function sleep
to be implemented using the SIGARLM
signal (sleep(3)
), meaning it is non-portable to mix use of that signal with sleep. The nanosleep
function, which std::thread::sleep
uses, is required by POSIX not to interfere with signals (nanosleep(2)
), so it should in fact be OK currently to mix std::thread::sleep
with SIGALRM
. However, this is not actually documented. Given that the Rust function is called "sleep" it is easy to be concerned that there might be a problem.
Could std::thread::sleep
make a documented commitment not to interfere with SIGALRM
?
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.