]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: avoid <1ms waits on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 4 May 2023 14:27:56 +0000 (14:27 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 30 Aug 2023 12:59:00 +0000 (12:59 +0000)
commitc8d09aeb88e6ce8573b8fb2c11a2209131910c16
tree7d05e4cccbdbb92386f4b383768e1705682db6f2
parenta17a82c6f425f51cf94f792146463bf5aafcf4c8
common: avoid <1ms waits on Windows

std::condition_variable::wait_for uses SleepConditionVariableSRW
on Windows, which has millisecond precision.

In order to avoid busy loops, we won't wait for less than one
millisecond on Windows.

Note that this situation is quite common since on Windows,
"wait_for" often returns ~1ms before the specified timeout.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/Timer.cc
src/common/ceph_timer.h