From Jason Turner

[thread.mutex.requirements.mutex]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpshp1s0_m/{from.md → to.md} +10 -10
tmp/tmpshp1s0_m/{from.md → to.md} RENAMED
@@ -1,12 +1,12 @@
1
  #### Mutex types <a id="thread.mutex.requirements.mutex">[[thread.mutex.requirements.mutex]]</a>
2
 
3
  The *mutex types* are the standard library types `std::mutex`,
4
- `std::recursive_mutex`, `std::timed_mutex`, and
5
- `std::recursive_timed_mutex`. They shall meet the requirements set out
6
- in this section. In this description, `m` denotes an object of a mutex
7
- type.
8
 
9
  The mutex types shall meet the `Lockable` requirements (
10
  [[thread.req.lockable.req]]).
11
 
12
  The mutex types shall be `DefaultConstructible` and `Destructible`. If
@@ -37,12 +37,12 @@ should be used to ensure that mutex objects are initialized and visible
37
  to other threads.
38
 
39
  The expression `m.lock()` shall be well-formed and have the following
40
  semantics:
41
 
42
- *Requires:* If `m` is of type `std::mutex` or `std::timed_mutex`, the
43
- calling thread does not own the mutex.
44
 
45
  *Effects:* Blocks the calling thread until ownership of the mutex can be
46
  obtained for the calling thread.
47
 
48
  The calling thread owns the mutex.
@@ -65,12 +65,12 @@ required ([[thread.req.exception]]).
65
  blocking is not possible.
66
 
67
  The expression `m.try_lock()` shall be well-formed and have the
68
  following semantics:
69
 
70
- *Requires:* If `m` is of type `std::mutex` or `std::timed_mutex`, the
71
- calling thread does not own the mutex.
72
 
73
  *Effects:* Attempts to obtain ownership of the mutex for the calling
74
  thread without blocking. If ownership is not obtained, there is no
75
  effect and `try_lock()` immediately returns. An implementation may fail
76
  to obtain the lock even if it is not held by any other thread. This
@@ -101,12 +101,12 @@ The calling thread shall own the mutex.
101
 
102
  *Effects:* Releases the calling thread’s ownership of the mutex.
103
 
104
  *Return type:* `void`
105
 
106
- *Synchronization:* This operation *synchronizes
107
- with* ([[intro.multithread]]) subsequent lock operations that obtain
108
  ownership on the same object.
109
 
110
  *Throws:* Nothing.
111
 
112
  ##### Class `mutex` <a id="thread.mutex.class">[[thread.mutex.class]]</a>
 
1
  #### Mutex types <a id="thread.mutex.requirements.mutex">[[thread.mutex.requirements.mutex]]</a>
2
 
3
  The *mutex types* are the standard library types `std::mutex`,
4
+ `std::recursive_mutex`, `std::timed_mutex`,
5
+ `std::recursive_timed_mutex`, and `std::shared_timed_mutex`. They shall
6
+ meet the requirements set out in this section. In this description, `m`
7
+ denotes an object of a mutex type.
8
 
9
  The mutex types shall meet the `Lockable` requirements (
10
  [[thread.req.lockable.req]]).
11
 
12
  The mutex types shall be `DefaultConstructible` and `Destructible`. If
 
37
  to other threads.
38
 
39
  The expression `m.lock()` shall be well-formed and have the following
40
  semantics:
41
 
42
+ *Requires:* If `m` is of type `std::mutex`, `std::timed_mutex`, or
43
+ `std::shared_timed_mutex`, the calling thread does not own the mutex.
44
 
45
  *Effects:* Blocks the calling thread until ownership of the mutex can be
46
  obtained for the calling thread.
47
 
48
  The calling thread owns the mutex.
 
65
  blocking is not possible.
66
 
67
  The expression `m.try_lock()` shall be well-formed and have the
68
  following semantics:
69
 
70
+ *Requires:* If `m` is of type `std::mutex`, `std::timed_mutex`, or
71
+ `std::shared_timed_mutex`, the calling thread does not own the mutex.
72
 
73
  *Effects:* Attempts to obtain ownership of the mutex for the calling
74
  thread without blocking. If ownership is not obtained, there is no
75
  effect and `try_lock()` immediately returns. An implementation may fail
76
  to obtain the lock even if it is not held by any other thread. This
 
101
 
102
  *Effects:* Releases the calling thread’s ownership of the mutex.
103
 
104
  *Return type:* `void`
105
 
106
+ *Synchronization:* This operation synchronizes
107
+ with ([[intro.multithread]]) subsequent lock operations that obtain
108
  ownership on the same object.
109
 
110
  *Throws:* Nothing.
111
 
112
  ##### Class `mutex` <a id="thread.mutex.class">[[thread.mutex.class]]</a>