From Jason Turner

[thread.mutex.class]

Diff to HTML by rtfpessoa

tmp/tmp6_fhiijf/{from.md → to.md} RENAMED
@@ -12,12 +12,12 @@ namespace std {
12
 
13
  void lock();
14
  bool try_lock();
15
  void unlock();
16
 
17
- using native_handle_type = implementation-defined; // See~[thread.req.native]
18
- native_handle_type native_handle(); // See~[thread.req.native]
19
  };
20
  }
21
  ```
22
 
23
  The class `mutex` provides a non-recursive mutex with exclusive
@@ -33,17 +33,17 @@ that it is no longer in use, unlock it, and destroy it, before thread
33
  required to handle such scenarios correctly, as long as thread `A`
34
  doesn’t access the mutex after the unlock call returns. These cases
35
  typically occur when a reference-counted object contains a mutex that is
36
  used to protect the reference count. — *end note*]
37
 
38
- The class `mutex` shall satisfy all of the mutex requirements (
39
- [[thread.mutex.requirements]]). It shall be a standard-layout class
40
- (Clause  [[class]]).
41
 
42
- [*Note 4*: A program may deadlock if the thread that owns a `mutex`
43
  object calls `lock()` on that object. If the implementation can detect
44
- the deadlock, a `resource_deadlock_would_occur` error condition may be
45
  observed. — *end note*]
46
 
47
  The behavior of a program is undefined if it destroys a `mutex` object
48
  owned by any thread or a thread terminates while owning a `mutex`
49
  object.
 
12
 
13
  void lock();
14
  bool try_lock();
15
  void unlock();
16
 
17
+ using native_handle_type = implementation-defined; // see~[thread.req.native]
18
+ native_handle_type native_handle(); // see~[thread.req.native]
19
  };
20
  }
21
  ```
22
 
23
  The class `mutex` provides a non-recursive mutex with exclusive
 
33
  required to handle such scenarios correctly, as long as thread `A`
34
  doesn’t access the mutex after the unlock call returns. These cases
35
  typically occur when a reference-counted object contains a mutex that is
36
  used to protect the reference count. — *end note*]
37
 
38
+ The class `mutex` meets all of the mutex requirements
39
+ [[thread.mutex.requirements]]. It is a standard-layout class
40
+ [[class.prop]].
41
 
42
+ [*Note 4*: A program can deadlock if the thread that owns a `mutex`
43
  object calls `lock()` on that object. If the implementation can detect
44
+ the deadlock, a `resource_deadlock_would_occur` error condition might be
45
  observed. — *end note*]
46
 
47
  The behavior of a program is undefined if it destroys a `mutex` object
48
  owned by any thread or a thread terminates while owning a `mutex`
49
  object.