1
The ti(namespace this_thread)hi(this_thread) is defined within the tt(std)
2
namespace, and contains functions that uniquely identify the current thread of
5
It offers the following members:
7
ithtq(get_id)(thread::id get_id() noexcept)
8
(returns an object of type tt(thread::id) that uniquely identifies the
9
currently active thread of execution. For an active thread the
10
returned tt(id)s is unique in that it 1:1 maps to the currently active
11
thread, and is not returned for any other thread. A default tt(id) is
12
returned when tt(get_id) is called for a thread that is currently not
14
ithtq(yield)(void yield() noexcept)(
15
the implementation may call tt(yield) to
16
reschedule. Cf. tt(thread::yield) in section ref(THREAD).)
18
(void sleep_for(chrono::duration<Rep, Period> const &relTime)
20
(this function is defined as a function template, defining the
21
template header tt(template <typename Rep, typename Period>). The template's
22
types are derived from the actual tt(relTime) argument that is passed
23
to the function, and should not explicitly be specified. This function
24
could be called as, e.g.,
26
sleep_for(seconds(5));
28
Calling this function blocks the thread calling this function during the
29
specified time interval, starting at the point in time the function is
32
(void sleep_until(chrono::time_point<Clock, Duration> const &absTime)
34
(this function is also defined as a function template, defining the
35
template header tt(template <typename Clock, typename Duration>). The
36
tt(Clock) and tt(Duration) types are derived from the actual
37
tt(absTime) argument that is passed to the function, and should not
38
explicitly be specified. This function could be called as, e.g.,
40
sleep_until(system_clock::now() + seconds(5));
42
Calling this function blocks the thread until the specified absolute