Wait until the next turn may be taken, or return immediately.

Synopsis

Declared in <bslmt_turnstile.h>

bsls::Types::Int64
waitTurn(bool sleep = true);

Description

Sleep until the next turn may be taken or return immediately if the optionally specified sleep is false, this turnstile is lagging behind schedule, or if the calculated sleep duration is less than minTimeToCallSleep. Return the non‐negative number of microseconds spent waiting, or if sleep is false, the number of microseconds the function would have had to wait.

Return Value

non‐negative microseconds spent waiting, or if sleep is false, the microseconds this function would have waited

Parameters

Name

Description

sleep

if false, do not sleep and report the wait duration

Created with MrDocs