From Jason Turner

[thread.lock.shared.locking]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_6g_xvnh/{from.md → to.md} +87 -0
tmp/tmp_6g_xvnh/{from.md → to.md} RENAMED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### `shared_lock` locking <a id="thread.lock.shared.locking">[[thread.lock.shared.locking]]</a>
2
+
3
+ ``` cpp
4
+ void lock();
5
+ ```
6
+
7
+ *Effects:* `pm->lock_shared()`.
8
+
9
+ *Postconditions:* `owns == true`.
10
+
11
+ *Throws:* Any exception thrown by `pm->lock_shared()`. `system_error` if
12
+ an exception is required ([[thread.req.exception]]). `system_error`
13
+ with an error condition of `operation_not_permitted` if `pm` is
14
+ `nullptr`. `system_error` with an error condition of
15
+ `resource_deadlock_would_occur` if on entry `owns` is `true`.
16
+
17
+ ``` cpp
18
+ bool try_lock();
19
+ ```
20
+
21
+ *Effects:* `pm->try_lock_shared()`.
22
+
23
+ *Returns:* The value returned by the call to `pm->try_lock_shared()`.
24
+
25
+ *Postconditions:* `owns == res`, where `res` is the value returned by
26
+ the call to `pm->try_lock_shared()`.
27
+
28
+ *Throws:* Any exception thrown by `pm->try_lock_shared()`.
29
+ `system_error` if an exception is required ([[thread.req.exception]]).
30
+ `system_error` with an error condition of `operation_not_permitted` if
31
+ `pm` is `nullptr`. `system_error` with an error condition of
32
+ `resource_deadlock_would_occur` if on entry `owns` is `true`.
33
+
34
+ ``` cpp
35
+ template <class Clock, class Duration>
36
+ bool
37
+ try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
38
+ ```
39
+
40
+ *Effects:* `pm->try_lock_shared_until(abs_time)`.
41
+
42
+ *Returns:* The value returned by the call to
43
+ `pm->try_lock_shared_until(abs_time)`.
44
+
45
+ *Postconditions:* `owns == res`, where `res` is the value returned by
46
+ the call to `pm->try_lock_shared_until(abs_time)`.
47
+
48
+ *Throws:* Any exception thrown by `pm->try_lock_shared_until(abs_time)`.
49
+ `system_error` if an exception is required ([[thread.req.exception]]).
50
+ `system_error` with an error condition of `operation_not_permitted` if
51
+ `pm` is `nullptr`. `system_error` with an error condition of
52
+ `resource_deadlock_would_occur` if on entry `owns` is `true`.
53
+
54
+ ``` cpp
55
+ template <class Rep, class Period>
56
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
57
+ ```
58
+
59
+ *Effects:* `pm->try_lock_shared_for(rel_time)`.
60
+
61
+ *Returns:* The value returned by the call to
62
+ `pm->try_lock_shared_for(rel_time)`.
63
+
64
+ *Postconditions:* `owns == res`, where `res` is the value returned by
65
+ the call to `pm->try_lock_shared_for(rel_time)`.
66
+
67
+ *Throws:* Any exception thrown by `pm->try_lock_shared_for(rel_time)`.
68
+ `system_error` if an exception is required  ([[thread.req.exception]]).
69
+ `system_error` with an error condition of `operation_not_permitted` if
70
+ `pm` is `nullptr`. `system_error` with an error condition of
71
+ `resource_deadlock_would_occur` if on entry `owns` is `true`.
72
+
73
+ ``` cpp
74
+ void unlock();
75
+ ```
76
+
77
+ *Effects:* `pm->unlock_shared()`.
78
+
79
+ *Postconditions:* `owns == false`.
80
+
81
+ *Throws:* `system_error` when an exception is required
82
+  ([[thread.req.exception]]).
83
+
84
+ *Error conditions:*
85
+
86
+ - `operation_not_permitted` — if on entry `owns` is `false`.
87
+