Minor optimizations to the thread sleeping mechanism.

Status Job ID Name Coverage
  Build
passed #3986
build_cmake

01:06

 
  Test
passed #3987
run_tests

01:06

 
  Sanitizer
passed #3988
run_address_sanitizer

02:18