Skip to content

Commit f3c809c

Browse files
jensmaurertkoeppe
authored andcommitted
[thread.lock] Extract error conditions from 'Throws' element. (#1122)
Fixes #458.
1 parent 87fb2d8 commit f3c809c

File tree

1 file changed

+73
-33
lines changed

1 file changed

+73
-33
lines changed

source/threads.tex

Lines changed: 73 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,11 +1967,16 @@
19671967

19681968
\pnum
19691969
\throws
1970-
Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} if an exception
1971-
is required~(\ref{thread.req.exception}). \tcode{system_error} with an error
1972-
condition of \tcode{operation_not_permitted} if \tcode{pm} is 0. \tcode{system_error}
1973-
with an error condition of \tcode{resource_deadlock_would_occur} if on entry \tcode{owns}
1970+
Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} when an exception
1971+
is required~(\ref{thread.req.exception}).
1972+
1973+
\pnum
1974+
\errors
1975+
\begin{itemize}
1976+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
1977+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
19741978
is \tcode{true}.
1979+
\end{itemize}
19751980
\end{itemdescr}
19761981

19771982
\indexlibrarymember{try_lock}{unique_lock}%
@@ -1993,12 +1998,18 @@
19931998
\postconditions \tcode{owns == res}, where \tcode{res} is the value returned by
19941999
the call to \tcode{try_lock()}.
19952000

1996-
\pnum\throws
1997-
Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} if an exception
1998-
is required~(\ref{thread.req.exception}). \tcode{system_error} with an error
1999-
condition of \tcode{operation_not_permitted} if \tcode{pm} is 0. \tcode{system_error}
2000-
with an error condition of \tcode{resource_deadlock_would_occur} if on entry \tcode{owns}
2001+
\pnum
2002+
\throws
2003+
Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} when an exception
2004+
is required~(\ref{thread.req.exception}).
2005+
2006+
\pnum
2007+
\errors
2008+
\begin{itemize}
2009+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2010+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
20012011
is \tcode{true}.
2012+
\end{itemize}
20022013
\end{itemdescr}
20032014

20042015
\indexlibrarymember{try_lock_until}{unique_lock}%
@@ -2023,11 +2034,16 @@
20232034
the call to \tcode{try_lock_until(abs_time)}.
20242035

20252036
\pnum
2026-
\throws Any exception thrown by \tcode{pm->try_lock_until()}. \tcode{system_error} if an
2027-
exception is required~(\ref{thread.req.exception}). \tcode{system_error} with an error
2028-
condition of \tcode{operation_not_permitted} if \tcode{pm} is 0. \tcode{system_error} with an
2029-
error condition of \tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is
2037+
\throws Any exception thrown by \tcode{pm->try_lock_until()}. \tcode{system_error} when an
2038+
exception is required~(\ref{thread.req.exception}).
2039+
2040+
\pnum
2041+
\errors
2042+
\begin{itemize}
2043+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2044+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
20302045
\tcode{true}.
2046+
\end{itemize}
20312047
\end{itemdescr}
20322048

20332049
\indexlibrarymember{try_lock_for}{unique_lock}%
@@ -2050,11 +2066,16 @@
20502066
\postconditions \tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{try_lock_for(rel_time)}.
20512067

20522068
\pnum
2053-
\throws Any exception thrown by \tcode{pm->try_lock_for()}. \tcode{system_error} if an
2054-
exception is required (\ref{thread.req.exception}). \tcode{system_error} with an error
2055-
condition of \tcode{operation_not_permitted} if \tcode{pm} is 0. \tcode{system_error} with an
2056-
error condition of \tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is
2069+
\throws Any exception thrown by \tcode{pm->try_lock_for()}. \tcode{system_error} when an
2070+
exception is required (\ref{thread.req.exception}).
2071+
2072+
\pnum
2073+
\errors
2074+
\begin{itemize}
2075+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2076+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
20572077
\tcode{true}.
2078+
\end{itemize}
20582079
\end{itemdescr}
20592080

20602081
\indexlibrarymember{unlock}{unique_lock}%
@@ -2384,11 +2405,15 @@
23842405

23852406
\pnum
23862407
\throws Any exception thrown by \tcode{pm->lock_shared()}.
2387-
\tcode{system_error} if an exception is required~(\ref{thread.req.exception}).
2388-
\tcode{system_error} with an error condition of
2389-
\tcode{operation_not_permitted} if \tcode{pm} is \tcode{nullptr}.
2390-
\tcode{system_error} with an error condition of
2391-
\tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is \tcode{true}.
2408+
\tcode{system_error} when an exception is required~(\ref{thread.req.exception}).
2409+
2410+
\pnum
2411+
\errors
2412+
\begin{itemize}
2413+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2414+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
2415+
\tcode{true}.
2416+
\end{itemize}
23922417
\end{itemdescr}
23932418

23942419
\indexlibrarymember{try_lock}{shared_lock}%
@@ -2409,12 +2434,15 @@
24092434

24102435
\pnum
24112436
\throws Any exception thrown by \tcode{pm->try_lock_shared()}.
2412-
\tcode{system_error} if an exception is required~(\ref{thread.req.exception}).
2413-
\tcode{system_error} with an error condition of
2414-
\tcode{operation_not_permitted} if \tcode{pm} is \tcode{nullptr}.
2415-
\tcode{system_error} with an error condition of
2416-
\tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is \tcode{true}.
2437+
\tcode{system_error} when an exception is required~(\ref{thread.req.exception}).
24172438

2439+
\pnum
2440+
\errors
2441+
\begin{itemize}
2442+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2443+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
2444+
\tcode{true}.
2445+
\end{itemize}
24182446
\end{itemdescr}
24192447

24202448
\indexlibrarymember{try_lock_until}{shared_lock}%
@@ -2438,11 +2466,15 @@
24382466

24392467
\pnum
24402468
\throws Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}.
2441-
\tcode{system_error} if an exception is required~(\ref{thread.req.exception}).
2442-
\tcode{system_error} with an error condition of
2443-
\tcode{operation_not_permitted} if \tcode{pm} is \tcode{nullptr}.
2444-
\tcode{system_error} with an error condition of
2445-
\tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is \tcode{true}.
2469+
\tcode{system_error} when an exception is required~(\ref{thread.req.exception}).
2470+
2471+
\pnum
2472+
\errors
2473+
\begin{itemize}
2474+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2475+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
2476+
\tcode{true}.
2477+
\end{itemize}
24462478
\end{itemdescr}
24472479

24482480
\indexlibrarymember{try_lock_for}{shared_lock}%
@@ -2462,7 +2494,15 @@
24622494
\postconditions \tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}.
24632495

24642496
\pnum
2465-
\throws Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} if an exception is required ~(\ref{thread.req.exception}). \tcode{system_error} with an error condition of \tcode{operation_not_permitted} if \tcode{pm} is \tcode{nullptr}. \tcode{system_error} with an error condition of \tcode{resource_deadlock_would_occur} if on entry \tcode{owns} is \tcode{true}.
2497+
\throws Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required~(\ref{thread.req.exception}).
2498+
2499+
\pnum
2500+
\errors
2501+
\begin{itemize}
2502+
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}.
2503+
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
2504+
\tcode{true}.
2505+
\end{itemize}
24662506
\end{itemdescr}
24672507

24682508
\indexlibrarymember{unlock}{shared_lock}%

0 commit comments

Comments
 (0)