mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
NonStop: Do not call sleep() with a 0 value
This change ensures that sleep(0) is not invoked to cause unexpected duplicate thread context switches when _REENTRANT is specified. Fixes: #24009 Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24012)
This commit is contained in:
parent
1a4b029af5
commit
c89fe57449
@ -31,7 +31,8 @@ void OSSL_sleep(uint64_t millis)
|
||||
unsigned int s = (unsigned int)(millis / 1000);
|
||||
unsigned int us = (unsigned int)((millis % 1000) * 1000);
|
||||
|
||||
sleep(s);
|
||||
if (s > 0)
|
||||
sleep(s);
|
||||
usleep(us);
|
||||
# endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user