Commit f620e1d5 by Jonathan Wakely Committed by Jonathan Wakely

Add std::scoped_lock for C++17

	* doc/xml/manual/status_cxx2017.xml: Document P0156R2 status.
	* doc/html/*: Regenerate.
	* include/std/mutex (scoped_lock): Implement new C++17 template.
	* testsuite/30_threads/scoped_lock/cons/1.cc: New test.
	* testsuite/30_threads/scoped_lock/requirements/
	explicit_instantiation.cc: New test.
	* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: New test.

From-SVN: r245903
parent d8b4baeb
2017-03-05 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/status_cxx2017.xml: Document P0156R2 status.
* doc/html/*: Regenerate.
* include/std/mutex (scoped_lock): Implement new C++17 template.
* testsuite/30_threads/scoped_lock/cons/1.cc: New test.
* testsuite/30_threads/scoped_lock/requirements/
explicit_instantiation.cc: New test.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc: New test.
2017-03-02 Gerald Pfeifer <gerald@pfeifer.com> 2017-03-02 Gerald Pfeifer <gerald@pfeifer.com>
François Dumont <frs.dumont@gmail.com> François Dumont <frs.dumont@gmail.com>
Jonathan Wakely <jwakely@redhat.com> Jonathan Wakely <jwakely@redhat.com>
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
DRD</a>, DRD</a>,
<a class="link" href="http://valgrind.org/docs/manual/hg-manual.html" target="_top"> <a class="link" href="http://valgrind.org/docs/manual/hg-manual.html" target="_top">
Helgrind</a>, and Helgrind</a>, and
<a class="link" href="https://code.google.com/p/data-race-test/" target="_top"> <a class="link" href="https://github.com/google/sanitizers" target="_top">
ThreadSanitizer</a> (this refers to ThreadSanitizer v1, not the ThreadSanitizer</a> (this refers to ThreadSanitizer v1, not the
new "tsan" feature built-in to GCC itself). new "tsan" feature built-in to GCC itself).
</p><p> </p><p>
......
...@@ -191,15 +191,11 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt; ...@@ -191,15 +191,11 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
perform, shortening the detect-compile-debug bug hunting cycle perform, shortening the detect-compile-debug bug hunting cycle
and making the debug mode easier to incorporate into development and making the debug mode easier to incorporate into development
environments by minimizing dependencies.</p><p>Achieving link- and run-time coexistence is not a trivial environments by minimizing dependencies.</p><p>Achieving link- and run-time coexistence is not a trivial
implementation task. To achieve this goal we required a small implementation task. To achieve this goal we use inline namespaces and
extension to the GNU C++ compiler (since incorporated into the C++11 language specification, described in the GCC Manual for the C++ language as a complex organization of debug- and release-modes. The end result is
<a class="link" href="http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html#Namespace-Association" target="_top">namespace that we have achieved per-use recompilation but have had to give up
association</a>), and a complex organization of debug- and some checking of the <code class="code">std::basic_string</code> class template
release-modes. The end result is that we have achieved per-use (namely, safe iterators).</p><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.compile"></a>Compile-time coexistence of release- and debug-mode components</h5></div></div></div><p>Both the release-mode components and the debug-mode
recompilation but have had to give up some checking of the
<code class="code">std::basic_string</code> class template (namely, safe
iterators).
</p><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.compile"></a>Compile-time coexistence of release- and debug-mode components</h5></div></div></div><p>Both the release-mode components and the debug-mode
components need to exist within a single translation unit so that components need to exist within a single translation unit so that
the debug versions can wrap the release versions. However, only one the debug versions can wrap the release versions. However, only one
of these components should be user-visible at any particular of these components should be user-visible at any particular
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>. <span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="table.doxygen_prereq"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p> </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="table.doxygen_prereq"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p>
Prerequisite tools are Bash 2.0 or later, Prerequisite tools are Bash 2.0 or later,
<a class="link" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and <a class="link" href="http://www.doxygen.org" target="_top">Doxygen</a>, and
the <a class="link" href="http://www.gnu.org/software/coreutils/" target="_top">GNU the <a class="link" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
coreutils</a>. (GNU versions of find, xargs, and possibly coreutils</a>. (GNU versions of find, xargs, and possibly
sed and grep are used, just because the GNU versions make sed and grep are used, just because the GNU versions make
......
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
</p><p> </p><p>
An instructive thread from comp.lang.c++.moderated delved off into An instructive thread from comp.lang.c++.moderated delved off into
this topic starting more or less at this topic starting more or less at
<a class="link" href="http://groups.google.com/group/comp.std.c++/browse_thread/thread/f87b4abd7954a87/946a3eb9921e382d?q=comp.std.c%2B%2B+binary+iostream#946a3eb9921e382d" target="_top">this</a> <a class="link" href="https://groups.google.com/forum/#!topic/comp.std.c++/D4e0q9eVSoc" target="_top">this post</a>
post and continuing to the end of the thread. (The subject heading is "binary iostreams" on both comp.std.c++ and continuing to the end of the thread. (The subject heading is "binary iostreams" on both comp.std.c++
and comp.lang.c++.moderated.) Take special note of the replies by James Kanze and Dietmar Kühl. and comp.lang.c++.moderated.) Take special note of the replies by James Kanze and Dietmar Kühl.
</p><p>Briefly, the problems of byte ordering and type sizes mean that </p><p>Briefly, the problems of byte ordering and type sizes mean that
the unformatted functions like <code class="code">ostream::put()</code> and the unformatted functions like <code class="code">ostream::put()</code> and
......
...@@ -671,7 +671,7 @@ be private. ...@@ -671,7 +671,7 @@ be private.
</em>. </span><span class="subtitle"> </em>. </span><span class="subtitle">
N2461 N2461
. </span></p></div><div class="biblioentry"><a id="id-1.3.4.4.4.5.8.5"></a><p><span class="title"><em> . </span></p></div><div class="biblioentry"><a id="id-1.3.4.4.4.5.8.5"></a><p><span class="title"><em>
<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm" target="_top"> <a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">
Boost C++ Libraries documentation, shared_ptr Boost C++ Libraries documentation, shared_ptr
</a> </a>
</em>. </span><span class="subtitle"> </em>. </span><span class="subtitle">
......
...@@ -834,7 +834,7 @@ ...@@ -834,7 +834,7 @@
</span>. </span><span class="publisher"><span class="publishername"> </span>. </span><span class="publisher"><span class="publishername">
Generic Programming Generic Programming
. </span></span></p></div><div class="biblioentry"><a id="biblio.dawestimer"></a><p>[biblio.dawestimer] <span class="title"><em> . </span></span></p></div><div class="biblioentry"><a id="biblio.dawestimer"></a><p>[biblio.dawestimer] <span class="title"><em>
<a class="link" href="http://www.boost.org/doc/libs/release/libs/timer/" target="_top"> <a class="link" href="http://www.boost.org/libs/timer/" target="_top">
Boost Timer Library Boost Timer Library
</a> </a>
</em>. </span><span class="author"><span class="firstname"> </em>. </span><span class="author"><span class="firstname">
...@@ -844,7 +844,7 @@ ...@@ -844,7 +844,7 @@
</span>. </span><span class="publisher"><span class="publishername"> </span>. </span><span class="publisher"><span class="publishername">
Boost Boost
. </span></span></p></div><div class="biblioentry"><a id="biblio.clearypool"></a><p>[biblio.clearypool] <span class="title"><em> . </span></span></p></div><div class="biblioentry"><a id="biblio.clearypool"></a><p>[biblio.clearypool] <span class="title"><em>
<a class="link" href="http://www.boost.org/doc/libs/release/libs/pool/" target="_top"> <a class="link" href="http://www.boost.org/libs/pool/" target="_top">
Boost Pool Library Boost Pool Library
</a> </a>
</em>. </span><span class="author"><span class="firstname"> </em>. </span><span class="author"><span class="firstname">
...@@ -854,7 +854,7 @@ ...@@ -854,7 +854,7 @@
</span>. </span><span class="publisher"><span class="publishername"> </span>. </span><span class="publisher"><span class="publishername">
Boost Boost
. </span></span></p></div><div class="biblioentry"><a id="biblio.maddocktraits"></a><p>[biblio.maddocktraits] <span class="title"><em> . </span></span></p></div><div class="biblioentry"><a id="biblio.maddocktraits"></a><p>[biblio.maddocktraits] <span class="title"><em>
<a class="link" href="http://www.boost.org/doc/libs/release/libs/type_traits/" target="_top"> <a class="link" href="http://www.boost.org/libs/type_traits/" target="_top">
Boost Type Traits Library Boost Type Traits Library
</a> </a>
</em>. </span><span class="authorgroup"><span class="firstname"> </em>. </span><span class="authorgroup"><span class="firstname">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
reverse iteration can be performed efficiently. reverse iteration can be performed efficiently.
</p></li></ol></div><p> </p></li></ol></div><p>
Some test utilities borrow ideas from Some test utilities borrow ideas from
<a class="link" href="http://www.boost.org/doc/libs/release/libs/timer/index.html" target="_top">boost::timer</a>. <a class="link" href="http://www.boost.org/libs/timer/" target="_top">boost::timer</a>.
</p><p> </p><p>
We would like to thank Scott Meyers for useful comments (without We would like to thank Scott Meyers for useful comments (without
attributing to him any flaws in the design or implementation of the attributing to him any flaws in the design or implementation of the
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
various components at interesting entry/exit points to/from the standard various components at interesting entry/exit points to/from the standard
library. Process trace, recognize suboptimal patterns, give advice. library. Process trace, recognize suboptimal patterns, give advice.
For details, see the For details, see the
<a class="link" href="http://http://ieeexplore.ieee.org/document/4907670/" target="_top">Perflint <a class="link" href="http://ieeexplore.ieee.org/document/4907670/" target="_top">Perflint
paper presented at CGO 2009</a>. paper presented at CGO 2009</a>.
</p><p> </p><p>
<span class="emphasis"><em>Strengths: </em></span> <span class="emphasis"><em>Strengths: </em></span>
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
call stack of its constructor location. call stack of its constructor location.
</p><p> </p><p>
For details, see For details, see
<a class="link" href="http://dx.doi.org/10.1109/CGO.2009.36" target="_top">paper presented at <a class="link" href="http://ieeexplore.ieee.org/document/4907670/" target="_top">paper presented at
CGO 2009</a>. CGO 2009</a>.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.analysis"></a>Analysis and Diagnostics</h3></div></div></div><p> </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.analysis"></a>Analysis and Diagnostics</h3></div></div></div><p>
Final analysis takes place offline, and it is based entirely on the Final analysis takes place offline, and it is based entirely on the
......
...@@ -776,11 +776,11 @@ Feature-testing recommendations for C++</a>. ...@@ -776,11 +776,11 @@ Feature-testing recommendations for C++</a>.
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4508.html" target="_top"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4508.html" target="_top">
N4508 N4508
</a> </a>
</td><td align="center"> 6.1 </td><td align="left"><code class="code"> __cpp_lib_shared_mutex &gt;= 201505 </code></td></tr><tr bgcolor="#C8B0B0"><td align="left"> Variadic <code class="code">lock_guard</code> </td><td align="left"> </td><td align="center"> 6.1 </td><td align="left"><code class="code"> __cpp_lib_shared_mutex &gt;= 201505 </code></td></tr><tr><td align="left"> Variadic <code class="code">lock_guard</code> </td><td align="left">
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0156r0.html" target="_top"> <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0156r2.html" target="_top">
P0156R0 P0156R2
</a> </a>
</td><td align="center"> No </td><td align="left"><code class="code"> __cpp_lib_lock_guard_variadic &gt;= 201510 </code></td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="table.cxx1z_ts_status"></a><p class="title"><strong>Table 1.6. C++ Technical Specifications Implementation Status</strong></p><div class="table-contents"><table summary="C++ Technical Specifications Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Paper</th><th align="left">Title</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"> </td><td align="center"> 7 </td><td align="left"><code class="code"> __cpp_lib_scoped_lock &gt;= 201703 </code></td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="table.cxx1z_ts_status"></a><p class="title"><strong>Table 1.6. C++ Technical Specifications Implementation Status</strong></p><div class="table-contents"><table summary="C++ Technical Specifications Implementation Status" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></colgroup><thead><tr><th align="left">Paper</th><th align="left">Title</th><th align="left">Status</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left">
<a class="link" href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4076.html" target="_top"> <a class="link" href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4076.html" target="_top">
N4076 N4076
</a> </a>
......
...@@ -719,15 +719,14 @@ Feature-testing recommendations for C++</link>. ...@@ -719,15 +719,14 @@ Feature-testing recommendations for C++</link>.
</row> </row>
<row> <row>
<?dbhtml bgcolor="#C8B0B0" ?>
<entry> Variadic <code>lock_guard</code> </entry> <entry> Variadic <code>lock_guard</code> </entry>
<entry> <entry>
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0156r0.html"> <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0156r2.html">
P0156R0 P0156R2
</link> </link>
</entry> </entry>
<entry align="center"> No </entry> <entry align="center"> 7 </entry>
<entry><code> __cpp_lib_lock_guard_variadic >= 201510 </code></entry> <entry><code> __cpp_lib_scoped_lock >= 201703 </code></entry>
</row> </row>
</tbody> </tbody>
......
...@@ -556,6 +556,74 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -556,6 +556,74 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
} }
#if __cplusplus > 201402L
#define __cpp_lib_scoped_lock 201703
/** @brief A scoped lock type for multiple lockable objects.
*
* A scoped_lock controls mutex ownership within a scope, releasing
* ownership in the destructor.
*/
template<typename... _MutexTypes>
class scoped_lock
{
public:
explicit scoped_lock(_MutexTypes&... __m) : _M_devices(std::tie(__m...))
{ std::lock(__m...); }
explicit scoped_lock(_MutexTypes&... __m, adopt_lock_t) noexcept
: _M_devices(std::tie(__m...))
{ } // calling thread owns mutex
~scoped_lock()
{
std::apply([](_MutexTypes&... __m) {
char __i[] __attribute__((__unused__)) = { (__m.unlock(), 0)... };
}, _M_devices);
}
scoped_lock(const scoped_lock&) = delete;
scoped_lock& operator=(const scoped_lock&) = delete;
private:
tuple<_MutexTypes&...> _M_devices;
};
template<>
class scoped_lock<>
{
public:
explicit scoped_lock() = default;
explicit scoped_lock(adopt_lock_t) noexcept { }
~scoped_lock() = default;
scoped_lock(const scoped_lock&) = delete;
scoped_lock& operator=(const scoped_lock&) = delete;
};
template<typename _Mutex>
class scoped_lock<_Mutex>
{
public:
using mutex_type = _Mutex;
explicit scoped_lock(mutex_type& __m) : _M_device(__m)
{ _M_device.lock(); }
explicit scoped_lock(mutex_type& __m, adopt_lock_t) noexcept
: _M_device(__m)
{ } // calling thread owns mutex
~scoped_lock()
{ _M_device.unlock(); }
scoped_lock(const scoped_lock&) = delete;
scoped_lock& operator=(const scoped_lock&) = delete;
private:
mutex_type& _M_device;
};
#endif // C++17
#ifdef _GLIBCXX_HAS_GTHREADS #ifdef _GLIBCXX_HAS_GTHREADS
/// once_flag /// once_flag
struct once_flag struct once_flag
......
// { dg-options "-std=gnu++17" }
// { dg-do run { target c++1z } }
// { dg-require-cstdint "" }
// Copyright (C) 2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <mutex>
#include <testsuite_hooks.h>
struct BasicLockable
{
BasicLockable() : locked(false) { }
~BasicLockable() noexcept(false)
{
if (locked)
throw 0;
}
void lock()
{
if (locked)
throw 0;
locked = true;
}
void unlock()
{
if (!locked)
throw 0;
locked = false;
}
bool locked;
};
template<int>
struct Lockable
{
BasicLockable m;
void lock() { m.lock(); }
void unlock() { m.unlock(); }
bool try_lock() { if (m.locked) return false; m.lock(); return true; }
};
void test01()
{
BasicLockable m;
try
{
std::scoped_lock<BasicLockable> l(m);
VERIFY( m.locked );
}
catch (...)
{
VERIFY( false );
}
VERIFY( !m.locked );
m.lock();
try
{
std::scoped_lock<BasicLockable> l(m, std::adopt_lock);
}
catch (...)
{
VERIFY( false );
}
VERIFY( !m.locked );
}
void test02()
{
Lockable<1> m1;
Lockable<2> m2;
try
{
std::scoped_lock<Lockable<1>, Lockable<2>> l(m1, m2);
VERIFY( m1.m.locked );
VERIFY( m2.m.locked );
}
catch (...)
{
VERIFY( false );
}
VERIFY( !m1.m.locked );
VERIFY( !m2.m.locked );
m1.lock();
m2.lock();
try
{
std::scoped_lock<Lockable<1>, Lockable<2>> l(m1, m2, std::adopt_lock);
VERIFY( m1.m.locked );
VERIFY( m2.m.locked );
}
catch (...)
{
VERIFY( false );
}
VERIFY( !m1.m.locked );
VERIFY( !m2.m.locked );
}
int main()
{
test01();
test02();
}
// { dg-options "-std=gnu++17" }
// { dg-do compile { target c++1z } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// NB: This file is for testing with NO OTHER INCLUDES.
#include <mutex>
namespace std
{
template class scoped_lock<>;
template class scoped_lock<mutex>;
template class scoped_lock<recursive_mutex, mutex>;
}
// { dg-options "-std=gnu++17" }
// { dg-do compile { target c++1z } }
// { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// NB: This file is for testing with NO OTHER INCLUDES.
#include <mutex>
void test01()
{
// Check for required typedefs
typedef std::scoped_lock<std::mutex> test_type;
typedef test_type::mutex_type mutex_type;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment