<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2126: Several specification problems in regard to mutex requirements</title>
<meta property="og:title" content="Issue 2126: Several specification problems in regard to mutex requirements">
<meta property="og:description" content="C++ library issue. Status: Pending NAD Editorial">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2126.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#NAD_Editorial">Pending NAD Editorial</a> status.</em></p>
<h3 id="2126"><a href="lwg-closed.html#2126">2126</a>. Several specification problems in regard to mutex requirements</h3>
<p><b>Section:</b> 32.6.4 <a href="https://wg21.link/thread.mutex.requirements">[thread.mutex.requirements]</a>, 32.6.4.2.2 <a href="https://wg21.link/thread.mutex.class">[thread.mutex.class]</a>, 32.6.4.2 <a href="https://wg21.link/thread.mutex.requirements.mutex">[thread.mutex.requirements.mutex]</a>, 32.6.4.2.3 <a href="https://wg21.link/thread.mutex.recursive">[thread.mutex.recursive]</a>, 32.6.4.3 <a href="https://wg21.link/thread.timedmutex.requirements">[thread.timedmutex.requirements]</a>, 32.6.4.3.2 <a href="https://wg21.link/thread.timedmutex.class">[thread.timedmutex.class]</a>, 32.6.4.3.3 <a href="https://wg21.link/thread.timedmutex.recursive">[thread.timedmutex.recursive]</a> <b>Status:</b> <a href="lwg-active.html#NAD_Editorial">Pending NAD Editorial</a>
 <b>Submitter:</b> Pete Becker <b>Opened:</b> 2012-01-16 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View other</b> <a href="lwg-index-open.html#thread.mutex.requirements">active issues</a> in [thread.mutex.requirements].</p>
<p><b>View all other</b> <a href="lwg-index.html#thread.mutex.requirements">issues</a> in [thread.mutex.requirements].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Pending NAD Editorial">Pending NAD Editorial</a> status.</p>
<p><b>Discussion:</b></p>

<p>
 32.6.4.2.2 <a href="https://wg21.link/thread.mutex.class">[thread.mutex.class]</a>&#47;3 says that the class mutex "shall satisfy all the <code>Mutex</code> requirements (32.6.4 <a href="https://wg21.link/thread.mutex.requirements">[thread.mutex.requirements]</a>)". 
 32.6.4.2.2 <a href="https://wg21.link/thread.mutex.class">[thread.mutex.class]</a> is part of 32.6.4 <a href="https://wg21.link/thread.mutex.requirements">[thread.mutex.requirements]</a>, so at the very least, this 
 requirement is recursive. But worse, there is nothing that says what "the <code>Mutex</code> requirements" refers to. For example, 
 the "<code>Lockable</code> requirements" section starts with "A type <code>L</code> meets the <code>Lockable</code> requirements if &hellip;". There is no such 
 statement for "the <code>Mutex</code> requirements".
<p/>
Organizationally, paragraphs 1-26 in 32.6.4.2 <a href="https://wg21.link/thread.mutex.requirements.mutex">[thread.mutex.requirements.mutex]</a> should probably be in a subclause with a name. 
(This is actually an ISO requirement, to avoid exactly this kind of ambiguous referencing) Then the first sentence of 
32.6.4.2.2 <a href="https://wg21.link/thread.mutex.class">[thread.mutex.class]</a>&#47;3 can become a note: "The class mutex meets the requirements of (whatever)", since that 
subclause already says that the mutex types "shall meet the requirements set out in this section."
<p/>
And similarly for 32.6.4.2.3 <a href="https://wg21.link/thread.mutex.recursive">[thread.mutex.recursive]</a>&#47;2 (<code>recursive_mutex</code>).
<p/>
32.6.4.3 <a href="https://wg21.link/thread.timedmutex.requirements">[thread.timedmutex.requirements]</a>, Timed mutex types, also needs the same rearrangement: its introductory 
requirements should be moved into a subclause, and the first sentences of 32.6.4.3.2 <a href="https://wg21.link/thread.timedmutex.class">[thread.timedmutex.class]</a>&#47;2 
and 32.6.4.3.3 <a href="https://wg21.link/thread.timedmutex.recursive">[thread.timedmutex.recursive]</a>&#47;2 should be turned into notes that refer to this new subclause and 
to the new subclause in 32.6.4.2 <a href="https://wg21.link/thread.mutex.requirements.mutex">[thread.mutex.requirements.mutex]</a>.
</p>

<p><i>[See also issue <a href="lwg-closed.html#2125" title="TimedMutex specification problem (Status: Pending NAD Editorial)">2125</a><sup><a href="https://cplusplus.github.io/LWG/issue2125" title="Latest snapshot">(i)</a></sup>]</i></p>


<p><i>[2012, Portland: move to Tentatively NAD Editorial]</i></p>

<p>
Seems no real ambiguity. May need some reorg of text rather then changing the wording.
</p>
<p>
Is there much that needs to be changed? But Pete's suggestion of putting requirement in separate sub section is good.
Should be the direction to editor.
</p>
<p>
Suggest this is an editorial change. Happy with Pete's comments.
</p>



<p id="res-2126"><b>Proposed resolution:</b></p>





</body>
</html>
