This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

### 968. Various threading bugs #18

Section: 32.5.4 [thread.mutex.requirements] Status: C++11 Submitter: Pete Becker Opened: 2009-01-07 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [thread.mutex.requirements].

View all other issues in [thread.mutex.requirements].

View all issues with C++11 status.

Discussion:

32.5.4 [thread.mutex.requirements]: several functions are required to throw exceptions "if the thread does not have the necessary permission ...". "The necessary permission" is not defined.

[ Summit: ]

> Move to open.

[ Beman has volunteered to provide proposed wording. ]

[ 2009-10 Santa Cruz: ]

> Moved to Ready with minor word-smithing in the example.

Proposed resolution:

Change Exceptions 32.2.2 [thread.req.exception] as indicated:

> Some functions described in this Clause are specified to throw exceptions of type `system_error` (19.5.5). Such exceptions shall be thrown if any of the Error conditions are detected or a call to an operating system or other underlying API results in an error that prevents the library function from meeting its specifications. [Note: See 16.4.6.13 [res.on.exception.handling] for exceptions thrown to report storage allocation failures. —end note]

> [Example:

> > Consider a function in this clause that is specified to throw exceptions of type `system_error` and specifies Error conditions that include `operation_not_permitted` for a thread that does not have the privilege to perform the operation. Assume that, during the execution of this function, an `errno` of `EPERM` is reported by a POSIX API call used by the implementation. Since POSIX specifies an `errno` of `EPERM` when "the caller does not have the privilege to perform the operation", the implementation maps `EPERM` to an `error_condition` of `operation_not_permitted` (19.5 [syserr]) and an exception of type `system_error` is thrown.

> —end example]

> Editorial note: For the sake of exposition, the existing text above is shown with the changes proposed in issues 962 and 967. The proposed additional example is independent of whether or not the 962 and 967 proposed resolutions are accepted.

Change Mutex requirements 32.5.4 [thread.mutex.requirements], paragraph 4, as indicated:

> — `operation_not_permitted` — if the thread does not have the necessary permission to change the state of the mutex object privilege to perform the operation.

Change Mutex requirements 32.5.4 [thread.mutex.requirements], paragraph 12, as indicated:

> — `operation_not_permitted` — if the thread does not have the necessary permission to change the state of the mutex privilege to perform the operation.