~ubuntu-branches/ubuntu/trusty/c++-annotations/trusty

« back to all changes in this revision

Viewing changes to yo/stl/thisthread.yo

  • Committer: Package Import Robot
  • Author(s): Frank B. Brokken
  • Date: 2013-05-30 13:32:18 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20130530133218-k39mr5uredd093jr
Tags: 9.7.2-1
New upstream release, repairs several minor left-over flaws.
This release incorporates 9.7.0 and 9.7.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
execution. 
 
4
 
 
5
It offers the following members:
 
6
    itemization(
 
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
 
13
        running.)
 
14
    ithtq(yield)(void yield() noexcept)(
 
15
       the implementation may call tt(yield) to
 
16
        reschedule. Cf. tt(thread::yield) in section ref(THREAD).)
 
17
    ithtq(sleep_for)
 
18
       (void sleep_for(chrono::duration<Rep, Period> const &relTime)
 
19
            noexcept) 
 
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., 
 
25
       verb(
 
26
    sleep_for(seconds(5));
 
27
        )
 
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
 
30
        called.)
 
31
    ithtq(sleep_until)
 
32
        (void sleep_until(chrono::time_point<Clock, Duration> const &absTime)
 
33
            noexcept)
 
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.,
 
39
       verb(
 
40
    sleep_until(system_clock::now() + seconds(5));
 
41
        )
 
42
       Calling this function blocks the thread until the specified absolute
 
43
        point in time.)
 
44
    )
 
45
 
 
46
 
 
47