Skip to content

Commit 43ee8ad

Browse files
committed
JP 14: [thread.sharedtimedmutex.class] Reformat synopsis for consistency
with nearby subclauses. Add "// blocking" comment systematically to lock() on all timed mutex classes. Fixes #374.
1 parent 7ddc895 commit 43ee8ad

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

source/threads.tex

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@
12311231
timed_mutex(const timed_mutex&) = delete;
12321232
timed_mutex& operator=(const timed_mutex&) = delete;
12331233

1234-
void lock();
1234+
void lock(); // blocking
12351235
bool try_lock();
12361236
template <class Rep, class Period>
12371237
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
@@ -1281,7 +1281,7 @@
12811281
recursive_timed_mutex(const recursive_timed_mutex&) = delete;
12821282
recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
12831283

1284-
void lock();
1284+
void lock(); // blocking
12851285
bool try_lock() noexcept;
12861286
template <class Rep, class Period>
12871287
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
@@ -1516,36 +1516,34 @@
15161516

15171517
\begin{codeblock}
15181518
namespace std {
1519-
1520-
class shared_timed_mutex {
1521-
public:
1522-
shared_timed_mutex();
1523-
~shared_timed_mutex();
1524-
1525-
shared_timed_mutex(const shared_timed_mutex&) = delete;
1526-
shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
1527-
1528-
// Exclusive ownership
1529-
void lock(); // blocking
1530-
bool try_lock();
1531-
template <class Rep, class Period>
1532-
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
1533-
template <class Clock, class Duration>
1534-
bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
1535-
void unlock();
1536-
1537-
// Shared ownership
1538-
void lock_shared(); // blocking
1539-
bool try_lock_shared();
1540-
template <class Rep, class Period>
1541-
bool
1542-
try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time);
1543-
template <class Clock, class Duration>
1544-
bool
1545-
try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time);
1546-
void unlock_shared();
1547-
};
1548-
1519+
class shared_timed_mutex {
1520+
public:
1521+
shared_timed_mutex();
1522+
~shared_timed_mutex();
1523+
1524+
shared_timed_mutex(const shared_timed_mutex&) = delete;
1525+
shared_timed_mutex& operator=(const shared_timed_mutex&) = delete;
1526+
1527+
// Exclusive ownership
1528+
void lock(); // blocking
1529+
bool try_lock();
1530+
template <class Rep, class Period>
1531+
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
1532+
template <class Clock, class Duration>
1533+
bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
1534+
void unlock();
1535+
1536+
// Shared ownership
1537+
void lock_shared(); // blocking
1538+
bool try_lock_shared();
1539+
template <class Rep, class Period>
1540+
bool
1541+
try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time);
1542+
template <class Clock, class Duration>
1543+
bool
1544+
try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time);
1545+
void unlock_shared();
1546+
};
15491547
}
15501548
\end{codeblock}
15511549

0 commit comments

Comments
 (0)