mirror of
https://github.com/boostorg/thread.git
synced 2026-02-09 11:32:12 +00:00
Compare commits
30 Commits
boost-1.34
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35b8104a7c | ||
|
|
a8daedac5e | ||
|
|
5fa26fb3ac | ||
|
|
ea3e297175 | ||
|
|
a11bd6ebd9 | ||
|
|
9889bf50a2 | ||
|
|
d75fb2deda | ||
|
|
6355a5b28d | ||
|
|
595bbee41e | ||
|
|
cb3f3a1f64 | ||
|
|
0e44838905 | ||
|
|
64cd268fc7 | ||
|
|
f048dd81f2 | ||
|
|
5746f2214c | ||
|
|
099af669d4 | ||
|
|
79cac706a7 | ||
|
|
df229074ac | ||
|
|
191c27e856 | ||
|
|
e5ee01b43c | ||
|
|
c46b040f6f | ||
|
|
72e4794f5b | ||
|
|
c30b65a0ea | ||
|
|
1cb08ff60c | ||
|
|
d3d7fd9317 | ||
|
|
acf0f97663 | ||
|
|
34bd87cea7 | ||
|
|
228f11262e | ||
|
|
9683e0f1cc | ||
|
|
674ae6d571 | ||
|
|
690d44e2e6 |
@@ -1,13 +1,8 @@
|
|||||||
# Copyright (C) 2001-2003
|
# Copyright (C) 2001-2003
|
||||||
# William E. Kempf
|
# William E. Kempf
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, distribute and sell this software
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
# and its documentation for any purpose is hereby granted without fee,
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
# provided that the above copyright notice appear in all copies and
|
|
||||||
# that both that copyright notice and this permission notice appear
|
|
||||||
# in supporting documentation. William E. Kempf makes no representations
|
|
||||||
# about the suitability of this software for any purpose.
|
|
||||||
# It is provided "as is" without express or implied warranty.
|
|
||||||
#
|
#
|
||||||
# Boost.Threads build Jamfile
|
# Boost.Threads build Jamfile
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
|
# (C) Copyright Vladimir Prus, David Abrahams, Michael Stevens, Hartmut Kaiser,
|
||||||
|
# William E Kempf 2002-2006
|
||||||
|
# Use, modification and distribution are subject to the
|
||||||
|
# Boost Software License, Version 1.0. (See accompanying file
|
||||||
|
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
import os ;
|
import os ;
|
||||||
|
|
||||||
if [ os.name ] = NT
|
|
||||||
{
|
|
||||||
reqts = <link>shared:<define>BOOST_THREAD_BUILD_DLL=1 ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
# Declare the uses system library
|
|
||||||
lib pthread : : <name>pthread ;
|
|
||||||
usage = <library>pthread ;
|
|
||||||
}
|
|
||||||
|
|
||||||
project boost/thread
|
project boost/thread
|
||||||
: source-location ../src
|
: source-location ../src
|
||||||
: usage-requirements $(usage)
|
: requirements <link>shared:<define>BOOST_THREAD_BUILD_DLL=1 <threading>multi
|
||||||
: requirements $(reqts) <threading>multi
|
|
||||||
: default-build <threading>multi
|
: default-build <threading>multi
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -36,6 +31,9 @@ CPP_SOURCES =
|
|||||||
|
|
||||||
lib boost_thread
|
lib boost_thread
|
||||||
: $(CPP_SOURCES).cpp
|
: $(CPP_SOURCES).cpp
|
||||||
|
: <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
|
||||||
|
<link>static:<define>BOOST_THREAD_BUILD_LIB=1
|
||||||
|
: # default build
|
||||||
: <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
|
: <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
|
||||||
<link>static:<define>BOOST_THREAD_BUILD_LIB=1
|
<link>static:<define>BOOST_THREAD_BUILD_LIB=1
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
# Copyright (C) 2001-2003
|
# Copyright (C) 2001-2003
|
||||||
# William E. Kempf
|
# William E. Kempf
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, distribute and sell this software
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
# and its documentation for any purpose is hereby granted without fee,
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
# provided that the above copyright notice appear in all copies and
|
|
||||||
# that both that copyright notice and this permission notice appear
|
|
||||||
# in supporting documentation. William E. Kempf makes no representations
|
|
||||||
# about the suitability of this software for any purpose.
|
|
||||||
# It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
# Additional configuration variables used:
|
# Additional configuration variables used:
|
||||||
# 1. PTW32_DIR and PTW32_LIB may be used on Win32 platforms to specify that
|
# 1. PTW32_DIR and PTW32_LIB may be used on Win32 platforms to specify that
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
# Copyright (C) 2001-2003
|
||||||
|
# William E. Kempf
|
||||||
|
#
|
||||||
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
import toolset ;
|
import toolset ;
|
||||||
toolset.using doxygen ;
|
toolset.using doxygen ;
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<section id="thread.acknowledgements"
|
<section id="thread.acknowledgements"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<title>Acknowledgements</title>
|
<title>Acknowledgements</title>
|
||||||
<para>William E. Kempf was the architect, designer, and implementor of
|
<para>William E. Kempf was the architect, designer, and implementor of
|
||||||
&Boost.Threads;.</para>
|
&Boost.Thread;.</para>
|
||||||
<para>Mac OS Carbon implementation written by Mac Murrett.</para>
|
<para>Mac OS Carbon implementation written by Mac Murrett.</para>
|
||||||
<para>Dave Moore provided initial submissions and further comments on the
|
<para>Dave Moore provided initial submissions and further comments on the
|
||||||
<code>barrier</code>
|
<code>barrier</code>
|
||||||
@@ -28,7 +32,7 @@ last-revision="$Date$">
|
|||||||
on the design), Paul Mclachlan, Thomas Matelich and Iain Hanson (for help
|
on the design), Paul Mclachlan, Thomas Matelich and Iain Hanson (for help
|
||||||
in trying to get the build to work on other platforms), and Kevin S. Van
|
in trying to get the build to work on other platforms), and Kevin S. Van
|
||||||
Horn (for several updates/corrections to the documentation).</para>
|
Horn (for several updates/corrections to the documentation).</para>
|
||||||
<para>Mike Glassford finished changes to &Boost.Threads; that were begun
|
<para>Mike Glassford finished changes to &Boost.Thread; that were begun
|
||||||
by William Kempf and moved them into the main CVS branch.
|
by William Kempf and moved them into the main CVS branch.
|
||||||
He also addressed a number of issues that were brought up on the Boost
|
He also addressed a number of issues that were brought up on the Boost
|
||||||
developer's mailing list and provided some additions and changes to the
|
developer's mailing list and provided some additions and changes to the
|
||||||
@@ -38,7 +42,7 @@ last-revision="$Date$">
|
|||||||
Mike Glassford finished William Kempf's conversion of the documentation to
|
Mike Glassford finished William Kempf's conversion of the documentation to
|
||||||
BoostBook format and added a number of new sections.</para>
|
BoostBook format and added a number of new sections.</para>
|
||||||
<para>Discussions on the boost.org mailing list were essential in the
|
<para>Discussions on the boost.org mailing list were essential in the
|
||||||
development of &Boost.Threads;
|
development of &Boost.Thread;
|
||||||
. As of August 1, 2001, participants included Alan Griffiths, Albrecht
|
. As of August 1, 2001, participants included Alan Griffiths, Albrecht
|
||||||
Fritzsche, Aleksey Gurtovoy, Alexander Terekhov, Andrew Green, Andy Sawyer,
|
Fritzsche, Aleksey Gurtovoy, Alexander Terekhov, Andrew Green, Andy Sawyer,
|
||||||
Asger Alstrup Nielsen, Beman Dawes, Bill Klein, Bill Rutiser, Bill Wade,
|
Asger Alstrup Nielsen, Beman Dawes, Bill Klein, Bill Rutiser, Bill Wade,
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/barrier.hpp"
|
<header name="boost/thread/barrier.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -32,9 +36,9 @@
|
|||||||
and reset the barrier. This functionality allows the same set of N threads to re-use
|
and reset the barrier. This functionality allows the same set of N threads to re-use
|
||||||
a barrier object to synchronize their execution at multiple points during their
|
a barrier object to synchronize their execution at multiple points during their
|
||||||
execution.</para>
|
execution.</para>
|
||||||
<para>See <xref linkend="threads.glossary"/> for definitions of thread
|
<para>See <xref linkend="thread.glossary"/> for definitions of thread
|
||||||
states <link linkend="threads.glossary.thread-state">blocked</link>
|
states <link linkend="thread.glossary.thread-state">blocked</link>
|
||||||
and <link linkend="threads.glossary.thread-state">ready</link>.
|
and <link linkend="thread.glossary.thread-state">ready</link>.
|
||||||
Note that "waiting" is a synonym for blocked.</para>
|
Note that "waiting" is a synonym for blocked.</para>
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<bibliography id="threads.bibliography"
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<bibliography id="thread.bibliography"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<title>Bibliography</title>
|
<title>Bibliography</title>
|
||||||
<biblioentry id="threads.bib.AndrewsSchneider83">
|
<biblioentry id="thread.bib.AndrewsSchneider83">
|
||||||
<abbrev id="threads.bib.AndrewsSchneider83.abbrev">AndrewsSchnieder83</abbrev>
|
<abbrev id="thread.bib.AndrewsSchneider83.abbrev">AndrewsSchnieder83</abbrev>
|
||||||
<biblioset relation="journal">
|
<biblioset relation="journal">
|
||||||
<title>ACM Computing Surveys</title>
|
<title>ACM Computing Surveys</title>
|
||||||
<volumenum>Vol. 15</volumenum>
|
<volumenum>Vol. 15</volumenum>
|
||||||
@@ -38,18 +42,18 @@ last-revision="$Date$">
|
|||||||
Expressions, Message Passing, and Remote Procedure Call in addition to the
|
Expressions, Message Passing, and Remote Procedure Call in addition to the
|
||||||
basics</para>
|
basics</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.Boost">
|
<biblioentry id="thread.bib.Boost">
|
||||||
<abbrev id="threads.bib.Boost.abbrev">Boost</abbrev>
|
<abbrev id="thread.bib.Boost.abbrev">Boost</abbrev>
|
||||||
<bibliomisc>The <emphasis>Boost</emphasis> world wide web site.
|
<bibliomisc>The <emphasis>Boost</emphasis> world wide web site.
|
||||||
<ulink url="http:/www.boost.org">http://www.boost.org</ulink></bibliomisc>
|
<ulink url="http:/www.boost.org">http://www.boost.org</ulink></bibliomisc>
|
||||||
<para>&Boost.Threads; is one of many Boost libraries. The Boost web
|
<para>&Boost.Thread; is one of many Boost libraries. The Boost web
|
||||||
site includes a great deal of documentation and general information which
|
site includes a great deal of documentation and general information which
|
||||||
applies to all Boost libraries. Current copies of the libraries including
|
applies to all Boost libraries. Current copies of the libraries including
|
||||||
documentation and test programs may be downloaded from the web
|
documentation and test programs may be downloaded from the web
|
||||||
site.</para>
|
site.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.Hansen73">
|
<biblioentry id="thread.bib.Hansen73">
|
||||||
<abbrev id="threads.bib.Hansen73.abbrev">Hansen73</abbrev>
|
<abbrev id="thread.bib.Hansen73.abbrev">Hansen73</abbrev>
|
||||||
<biblioset relation="journal">
|
<biblioset relation="journal">
|
||||||
<title>ACM Computing Surveys</title>
|
<title>ACM Computing Surveys</title>
|
||||||
<volumenum>Vol. 5</volumenum>
|
<volumenum>Vol. 5</volumenum>
|
||||||
@@ -74,8 +78,8 @@ last-revision="$Date$">
|
|||||||
Brinch Hansen was years ahead of others in recognizing pattern concepts
|
Brinch Hansen was years ahead of others in recognizing pattern concepts
|
||||||
applied to software, too.</para>
|
applied to software, too.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.Butenhof97">
|
<biblioentry id="thread.bib.Butenhof97">
|
||||||
<abbrev id="threads.bib.Butenhof97.abbrev">Butenhof97</abbrev>
|
<abbrev id="thread.bib.Butenhof97.abbrev">Butenhof97</abbrev>
|
||||||
<title>
|
<title>
|
||||||
<ulink url="http://cseng.aw.com/book/0,3828,0201633922,00.html"
|
<ulink url="http://cseng.aw.com/book/0,3828,0201633922,00.html"
|
||||||
>Programming with POSIX Threads </ulink>
|
>Programming with POSIX Threads </ulink>
|
||||||
@@ -92,8 +96,8 @@ last-revision="$Date$">
|
|||||||
them. Many of the insights given apply to all multithreaded programming, not
|
them. Many of the insights given apply to all multithreaded programming, not
|
||||||
just POSIX Threads</para>
|
just POSIX Threads</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.Hoare74">
|
<biblioentry id="thread.bib.Hoare74">
|
||||||
<abbrev id="threads.bib.Hoare74.abbrev">Hoare74</abbrev>
|
<abbrev id="thread.bib.Hoare74.abbrev">Hoare74</abbrev>
|
||||||
<biblioset relation="journal">
|
<biblioset relation="journal">
|
||||||
<title>Communications of the ACM</title>
|
<title>Communications of the ACM</title>
|
||||||
<volumenum>Vol. 17</volumenum>
|
<volumenum>Vol. 17</volumenum>
|
||||||
@@ -115,8 +119,8 @@ last-revision="$Date$">
|
|||||||
multithreading patterns. This is one of the most often referenced papers in
|
multithreading patterns. This is one of the most often referenced papers in
|
||||||
all of computer science, and with good reason.</para>
|
all of computer science, and with good reason.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.ISO98">
|
<biblioentry id="thread.bib.ISO98">
|
||||||
<abbrev id="threads.bib.ISO98.abbrev">ISO98</abbrev>
|
<abbrev id="thread.bib.ISO98.abbrev">ISO98</abbrev>
|
||||||
<title>
|
<title>
|
||||||
<ulink url="http://www.ansi.org">Programming Language C++</ulink>
|
<ulink url="http://www.ansi.org">Programming Language C++</ulink>
|
||||||
</title>
|
</title>
|
||||||
@@ -125,8 +129,8 @@ last-revision="$Date$">
|
|||||||
<para>This is the official C++ Standards document. Available from the ANSI
|
<para>This is the official C++ Standards document. Available from the ANSI
|
||||||
(American National Standards Institute) Electronic Standards Store.</para>
|
(American National Standards Institute) Electronic Standards Store.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.McDowellHelmbold89">
|
<biblioentry id="thread.bib.McDowellHelmbold89">
|
||||||
<abbrev id="threads.bib.McDowellHelmbold89.abbrev">McDowellHelmbold89</abbrev>
|
<abbrev id="thread.bib.McDowellHelmbold89.abbrev">McDowellHelmbold89</abbrev>
|
||||||
<biblioset relation="journal">
|
<biblioset relation="journal">
|
||||||
<title>Communications of the ACM</title>
|
<title>Communications of the ACM</title>
|
||||||
<volumenum>Vol. 21</volumenum>
|
<volumenum>Vol. 21</volumenum>
|
||||||
@@ -153,8 +157,8 @@ last-revision="$Date$">
|
|||||||
<para>Identifies many of the unique failure modes and debugging difficulties
|
<para>Identifies many of the unique failure modes and debugging difficulties
|
||||||
associated with concurrent programs.</para>
|
associated with concurrent programs.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.SchmidtPyarali">
|
<biblioentry id="thread.bib.SchmidtPyarali">
|
||||||
<abbrev id="threads.bib.SchmidtPyarali.abbrev">SchmidtPyarali</abbrev>
|
<abbrev id="thread.bib.SchmidtPyarali.abbrev">SchmidtPyarali</abbrev>
|
||||||
<title>
|
<title>
|
||||||
<ulink url="http://www.cs.wustl.edu/~schmidt/win32-cv-1.html8"
|
<ulink url="http://www.cs.wustl.edu/~schmidt/win32-cv-1.html8"
|
||||||
>Strategies for Implementing POSIX Condition Variables on Win32</ulink>
|
>Strategies for Implementing POSIX Condition Variables on Win32</ulink>
|
||||||
@@ -172,14 +176,14 @@ last-revision="$Date$">
|
|||||||
</authorgroup>
|
</authorgroup>
|
||||||
<orgname>Department of Computer Science, Washington University, St. Louis,
|
<orgname>Department of Computer Science, Washington University, St. Louis,
|
||||||
Missouri</orgname>
|
Missouri</orgname>
|
||||||
<para>Rationale for understanding &Boost.Threads; condition
|
<para>Rationale for understanding &Boost.Thread; condition
|
||||||
variables. Note that Alexander Terekhov found some bugs in the
|
variables. Note that Alexander Terekhov found some bugs in the
|
||||||
implementation given in this article, so pthreads-win32 and &Boost.Threads;
|
implementation given in this article, so pthreads-win32 and &Boost.Thread;
|
||||||
are even more complicated yet.</para>
|
are even more complicated yet.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.SchmidtStalRohnertBuschmann">
|
<biblioentry id="thread.bib.SchmidtStalRohnertBuschmann">
|
||||||
<abbrev
|
<abbrev
|
||||||
id="threads.bib.SchmidtStalRohnertBuschmann.abbrev">SchmidtStalRohnertBuschmann</abbrev>
|
id="thread.bib.SchmidtStalRohnertBuschmann.abbrev">SchmidtStalRohnertBuschmann</abbrev>
|
||||||
<title>
|
<title>
|
||||||
<ulink
|
<ulink
|
||||||
url="http://www.wiley.com/Corporate/Website/Objects/Products/0,9049,104671,00.html"
|
url="http://www.wiley.com/Corporate/Website/Objects/Products/0,9049,104671,00.html"
|
||||||
@@ -210,11 +214,11 @@ last-revision="$Date$">
|
|||||||
<copyright><year>2000</year></copyright>
|
<copyright><year>2000</year></copyright>
|
||||||
<para>This is a very good explanation of how to apply several patterns
|
<para>This is a very good explanation of how to apply several patterns
|
||||||
useful for concurrent programming. Among the patterns documented is the
|
useful for concurrent programming. Among the patterns documented is the
|
||||||
Monitor Pattern mentioned frequently in the &Boost.Threads;
|
Monitor Pattern mentioned frequently in the &Boost.Thread;
|
||||||
documentation.</para>
|
documentation.</para>
|
||||||
</biblioentry>
|
</biblioentry>
|
||||||
<biblioentry id="threads.bib.Stroustrup">
|
<biblioentry id="thread.bib.Stroustrup">
|
||||||
<abbrev id="threads.bib.Stroustrup.abbrev">Stroustrup</abbrev>
|
<abbrev id="thread.bib.Stroustrup.abbrev">Stroustrup</abbrev>
|
||||||
<title>
|
<title>
|
||||||
<ulink url="http://cseng.aw.com/book/0,3828,0201700735,00.html"
|
<ulink url="http://cseng.aw.com/book/0,3828,0201700735,00.html"
|
||||||
>The C++ Programming Language</ulink>
|
>The C++ Programming Language</ulink>
|
||||||
|
|||||||
@@ -1,45 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<section id="thread.build" last-revision="$Date$">
|
<section id="thread.build" last-revision="$Date$">
|
||||||
<title>Build</title>
|
<title>Build</title>
|
||||||
<para>
|
<para>
|
||||||
How you build the &Boost.Threads; libraries, and how you build your own applications
|
How you build the &Boost.Thread; libraries, and how you build your own applications
|
||||||
that use those libraries, are some of the most frequently asked questions. Build
|
that use those libraries, are some of the most frequently asked questions. Build
|
||||||
processes are difficult to deal with in a portable manner. That's one reason
|
processes are difficult to deal with in a portable manner. That's one reason
|
||||||
why &Boost.Threads; makes use of &Boost.Build;.
|
why &Boost.Thread; makes use of &Boost.Build;.
|
||||||
In general you should refer to the documentation for &Boost.Build;.
|
In general you should refer to the documentation for &Boost.Build;.
|
||||||
This document will only supply you with some simple usage examples for how to
|
This document will only supply you with some simple usage examples for how to
|
||||||
use <emphasis>bjam</emphasis> to build and test &Boost.Threads;. In addition, this document
|
use <emphasis>bjam</emphasis> to build and test &Boost.Thread;. In addition, this document
|
||||||
will try to explain the build requirements so that users may create their own
|
will try to explain the build requirements so that users may create their own
|
||||||
build processes (for instance, create an IDE specific project), both for building
|
build processes (for instance, create an IDE specific project), both for building
|
||||||
and testing &Boost.Threads;, as well as for building their own projects using
|
and testing &Boost.Thread;, as well as for building their own projects using
|
||||||
&Boost.Threads;.
|
&Boost.Thread;.
|
||||||
</para>
|
</para>
|
||||||
<section id="thread.build.building">
|
<section id="thread.build.building">
|
||||||
<title>Building the &Boost.Threads; Libraries</title>
|
<title>Building the &Boost.Thread; Libraries</title>
|
||||||
<para>
|
<para>
|
||||||
To build the &Boost.Threads; libraries using &Boost.Build;, simply change to the
|
To build the &Boost.Thread; libraries using &Boost.Build;, simply change to the
|
||||||
directory <emphasis>boost_root</emphasis>/libs/thread/build and execute the command:
|
directory <emphasis>boost_root</emphasis>/libs/thread/build and execute the command:
|
||||||
<programlisting>bjam -sTOOLS=<emphasis>toolset</emphasis></programlisting>
|
<programlisting>bjam -sTOOLS=<emphasis>toolset</emphasis></programlisting>
|
||||||
This will create the debug and the release builds of the &Boost.Threads; library.
|
This will create the debug and the release builds of the &Boost.Thread; library.
|
||||||
<note>Invoking the above command in <emphasis>boost_root</emphasis> will build all of
|
<note>Invoking the above command in <emphasis>boost_root</emphasis> will build all of
|
||||||
the Boost distribution, including &Boost.Threads;.</note>
|
the Boost distribution, including &Boost.Thread;.</note>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The Jamfile supplied with &Boost.Threads; produces a dynamic link library named
|
The Jamfile supplied with &Boost.Thread; produces a dynamic link library named
|
||||||
<emphasis>boost_thread{build-specific-tags}.{extension}</emphasis>, where the build-specific
|
<emphasis>boost_thread{build-specific-tags}.{extension}</emphasis>, where the build-specific
|
||||||
tags indicate the toolset used to build the library, whether it's a debug or release
|
tags indicate the toolset used to build the library, whether it's a debug or release
|
||||||
build, what version of Boost was used, etc.; and the extension is the appropriate extension
|
build, what version of Boost was used, etc.; and the extension is the appropriate extension
|
||||||
for a dynamic link library for the platform for which &Boost.Threads; is being built.
|
for a dynamic link library for the platform for which &Boost.Thread; is being built.
|
||||||
For instance, a debug library built for Win32 with VC++ 7.1 using Boost 1.31 would
|
For instance, a debug library built for Win32 with VC++ 7.1 using Boost 1.31 would
|
||||||
be named <emphasis>boost_thread-vc71-mt-gd-1_31.dll</emphasis>.
|
be named <emphasis>boost_thread-vc71-mt-gd-1_31.dll</emphasis>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The source files that are used to create the &Boost.Threads; library
|
The source files that are used to create the &Boost.Thread; library
|
||||||
are all of the *.cpp files found in <emphasis>boost_root</emphasis>/libs/thread/src.
|
are all of the *.cpp files found in <emphasis>boost_root</emphasis>/libs/thread/src.
|
||||||
These need to be built with the compiler's and linker's multi-threading support enabled.
|
These need to be built with the compiler's and linker's multi-threading support enabled.
|
||||||
If you want to create your own build solution you'll have to follow these same
|
If you want to create your own build solution you'll have to follow these same
|
||||||
@@ -48,9 +52,9 @@
|
|||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="thread.build.testing">
|
<section id="thread.build.testing">
|
||||||
<title>Testing the &Boost.Threads; Libraries</title>
|
<title>Testing the &Boost.Thread; Libraries</title>
|
||||||
<para>
|
<para>
|
||||||
To test the &Boost.Threads; libraries using &Boost.Build;, simply change to the
|
To test the &Boost.Thread; libraries using &Boost.Build;, simply change to the
|
||||||
directory <emphasis>boost_root</emphasis>/libs/thread/test and execute the command:
|
directory <emphasis>boost_root</emphasis>/libs/thread/test and execute the command:
|
||||||
<programlisting>bjam -sTOOLS=<emphasis>toolset</emphasis> test</programlisting>
|
<programlisting>bjam -sTOOLS=<emphasis>toolset</emphasis> test</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|||||||
440
doc/concepts.xml
440
doc/concepts.xml
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/condition.hpp"
|
<header name="boost/thread/condition.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -21,12 +25,12 @@
|
|||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>A <classname>condition</classname> object is always used in
|
<para>A <classname>condition</classname> object is always used in
|
||||||
conjunction with a <link linkend="threads.concepts.mutexes">mutex</link>
|
conjunction with a <link linkend="thread.concepts.mutexes">mutex</link>
|
||||||
object (an object whose type is a model of a <link
|
object (an object whose type is a model of a <link
|
||||||
linkend="threads.concepts.Mutex">Mutex</link> or one of its
|
linkend="thread.concepts.Mutex">Mutex</link> or one of its
|
||||||
refinements). The mutex object must be locked prior to waiting on the
|
refinements). The mutex object must be locked prior to waiting on the
|
||||||
condition, which is verified by passing a lock object (an object whose
|
condition, which is verified by passing a lock object (an object whose
|
||||||
type is a model of <link linkend="threads.concepts.Lock">Lock</link> or
|
type is a model of <link linkend="thread.concepts.Lock">Lock</link> or
|
||||||
one of its refinements) to the <classname>condition</classname> object's
|
one of its refinements) to the <classname>condition</classname> object's
|
||||||
wait functions. Upon blocking on the <classname>condition</classname>
|
wait functions. Upon blocking on the <classname>condition</classname>
|
||||||
object, the thread unlocks the mutex object. When the thread returns
|
object, the thread unlocks the mutex object. When the thread returns
|
||||||
@@ -39,8 +43,8 @@
|
|||||||
&cite.SchmidtStalRohnertBuschmann; and &cite.Hoare74;). Monitors are one
|
&cite.SchmidtStalRohnertBuschmann; and &cite.Hoare74;). Monitors are one
|
||||||
of the most important patterns for creating reliable multithreaded
|
of the most important patterns for creating reliable multithreaded
|
||||||
programs.</para>
|
programs.</para>
|
||||||
<para>See <xref linkend="threads.glossary"/> for definitions of <link
|
<para>See <xref linkend="thread.glossary"/> for definitions of <link
|
||||||
linkend="threads.glossary.thread-state">thread states</link>
|
linkend="thread.glossary.thread-state">thread states</link>
|
||||||
blocked and ready. Note that "waiting" is a synonym for blocked.</para>
|
blocked and ready. Note that "waiting" is a synonym for blocked.</para>
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
@@ -87,10 +91,10 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
|
|
||||||
<requires><simpara><code>ScopedLock</code> meets the <link
|
<requires><simpara><code>ScopedLock</code> meets the <link
|
||||||
linkend="threads.concepts.ScopedLock">ScopedLock</link>
|
linkend="thread.concepts.ScopedLock">ScopedLock</link>
|
||||||
requirements.</simpara></requires>
|
requirements.</simpara></requires>
|
||||||
<effects><simpara>Releases the lock on the <link
|
<effects><simpara>Releases the lock on the <link
|
||||||
linkend="threads.concepts.mutexes">mutex object</link>
|
linkend="thread.concepts.mutexes">mutex object</link>
|
||||||
associated with <code>lock</code>, blocks the current thread of execution
|
associated with <code>lock</code>, blocks the current thread of execution
|
||||||
until readied by a call to <code>this->notify_one()</code>
|
until readied by a call to <code>this->notify_one()</code>
|
||||||
or<code> this->notify_all()</code>, and then reacquires the
|
or<code> this->notify_all()</code>, and then reacquires the
|
||||||
@@ -116,7 +120,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
|
|
||||||
<requires><simpara><code>ScopedLock</code> meets the <link
|
<requires><simpara><code>ScopedLock</code> meets the <link
|
||||||
linkend="threads.concepts.ScopedLock">ScopedLock</link>
|
linkend="thread.concepts.ScopedLock">ScopedLock</link>
|
||||||
requirements and the return from <code>pred()</code> is
|
requirements and the return from <code>pred()</code> is
|
||||||
convertible to <code>bool</code>.</simpara></requires>
|
convertible to <code>bool</code>.</simpara></requires>
|
||||||
<effects><simpara>As if: <code>while (!pred())
|
<effects><simpara>As if: <code>while (!pred())
|
||||||
@@ -141,10 +145,10 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
|
|
||||||
<requires><simpara><code>ScopedLock</code> meets the <link
|
<requires><simpara><code>ScopedLock</code> meets the <link
|
||||||
linkend="threads.concepts.ScopedLock">ScopedLock</link>
|
linkend="thread.concepts.ScopedLock">ScopedLock</link>
|
||||||
requirements.</simpara></requires>
|
requirements.</simpara></requires>
|
||||||
<effects><simpara>Releases the lock on the <link
|
<effects><simpara>Releases the lock on the <link
|
||||||
linkend="threads.concepts.mutexes">mutex object</link>
|
linkend="thread.concepts.mutexes">mutex object</link>
|
||||||
associated with <code>lock</code>, blocks the current thread of execution
|
associated with <code>lock</code>, blocks the current thread of execution
|
||||||
until readied by a call to <code>this->notify_one()</code>
|
until readied by a call to <code>this->notify_one()</code>
|
||||||
or<code> this->notify_all()</code>, or until time <code>xt</code>
|
or<code> this->notify_all()</code>, or until time <code>xt</code>
|
||||||
@@ -176,7 +180,7 @@
|
|||||||
</parameter>
|
</parameter>
|
||||||
|
|
||||||
<requires><simpara><code>ScopedLock</code> meets the <link
|
<requires><simpara><code>ScopedLock</code> meets the <link
|
||||||
linkend="threads.concepts.ScopedLock">ScopedLock</link>
|
linkend="thread.concepts.ScopedLock">ScopedLock</link>
|
||||||
requirements and the return from <code>pred()</code> is
|
requirements and the return from <code>pred()</code> is
|
||||||
convertible to <code>bool</code>.</simpara></requires>
|
convertible to <code>bool</code>.</simpara></requires>
|
||||||
<effects><simpara>As if: <code>while (!pred()) { if (!timed_wait(lock,
|
<effects><simpara>As if: <code>while (!pred()) { if (!timed_wait(lock,
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<section id="thread.configuration" last-revision="$Date$">
|
<section id="thread.configuration" last-revision="$Date$">
|
||||||
<title>Configuration</title>
|
<title>Configuration</title>
|
||||||
<para>&Boost.Threads; uses several configuration macros in <boost/config.hpp>,
|
<para>&Boost.Thread; uses several configuration macros in <boost/config.hpp>,
|
||||||
as well as configuration macros meant to be supplied by the application. These
|
as well as configuration macros meant to be supplied by the application. These
|
||||||
macros are documented here.
|
macros are documented here.
|
||||||
</para>
|
</para>
|
||||||
<section id="thread.configuration.public">
|
<section id="thread.configuration.public">
|
||||||
<title>Library Defined Public Macros</title>
|
<title>Library Defined Public Macros</title>
|
||||||
<para>
|
<para>
|
||||||
These macros are defined by &Boost.Threads; but are expected to be used
|
These macros are defined by &Boost.Thread; but are expected to be used
|
||||||
by application code.
|
by application code.
|
||||||
</para>
|
</para>
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -29,9 +33,9 @@
|
|||||||
<entry>BOOST_HAS_THREADS</entry>
|
<entry>BOOST_HAS_THREADS</entry>
|
||||||
<entry>
|
<entry>
|
||||||
Indicates that threading support is available. This means both that there
|
Indicates that threading support is available. This means both that there
|
||||||
is a platform specific implementation for &Boost.Threads; and that
|
is a platform specific implementation for &Boost.Thread; and that
|
||||||
threading support has been enabled in a platform specific manner. For instance,
|
threading support has been enabled in a platform specific manner. For instance,
|
||||||
on the Win32 platform there's an implementation for &Boost.Threads;
|
on the Win32 platform there's an implementation for &Boost.Thread;
|
||||||
but unless the program is compiled against one of the multithreading runtimes
|
but unless the program is compiled against one of the multithreading runtimes
|
||||||
(often determined by the compiler predefining the macro _MT) the BOOST_HAS_THREADS
|
(often determined by the compiler predefining the macro _MT) the BOOST_HAS_THREADS
|
||||||
macro remains undefined.
|
macro remains undefined.
|
||||||
@@ -44,7 +48,7 @@
|
|||||||
<section id="thread.configuration.implementation">
|
<section id="thread.configuration.implementation">
|
||||||
<title>Library Defined Implementation Macros</title>
|
<title>Library Defined Implementation Macros</title>
|
||||||
<para>
|
<para>
|
||||||
These macros are defined by &Boost.Threads; and are implementation details
|
These macros are defined by &Boost.Thread; and are implementation details
|
||||||
of interest only to implementors.
|
of interest only to implementors.
|
||||||
</para>
|
</para>
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -60,14 +64,14 @@
|
|||||||
<entry>BOOST_HAS_WINTHREADS</entry>
|
<entry>BOOST_HAS_WINTHREADS</entry>
|
||||||
<entry>
|
<entry>
|
||||||
Indicates that the platform has the Microsoft Win32 threading libraries,
|
Indicates that the platform has the Microsoft Win32 threading libraries,
|
||||||
and that they should be used to implement &Boost.Threads;.
|
and that they should be used to implement &Boost.Thread;.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>BOOST_HAS_PTHREADS</entry>
|
<entry>BOOST_HAS_PTHREADS</entry>
|
||||||
<entry>
|
<entry>
|
||||||
Indicates that the platform has the POSIX pthreads libraries, and that
|
Indicates that the platform has the POSIX pthreads libraries, and that
|
||||||
they should be used to implement &Boost.Threads;.
|
they should be used to implement &Boost.Thread;.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.design" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.design" last-revision="$Date$">
|
||||||
<title>Design</title>
|
<title>Design</title>
|
||||||
<para>With client/server and three-tier architectures becoming common place
|
<para>With client/server and three-tier architectures becoming common place
|
||||||
in today's world, it's becoming increasingly important for programs to be
|
in today's world, it's becoming increasingly important for programs to be
|
||||||
@@ -15,18 +19,18 @@
|
|||||||
Further, these APIs are almost universally C APIs and fail to take
|
Further, these APIs are almost universally C APIs and fail to take
|
||||||
advantage of C++'s strengths, or to address concepts unique to C++, such as
|
advantage of C++'s strengths, or to address concepts unique to C++, such as
|
||||||
exceptions.</para>
|
exceptions.</para>
|
||||||
<para>The &Boost.Threads; library is an attempt to define a portable interface
|
<para>The &Boost.Thread; library is an attempt to define a portable interface
|
||||||
for writing parallel processes in C++.</para>
|
for writing parallel processes in C++.</para>
|
||||||
<section id="threads.design.goals">
|
<section id="thread.design.goals">
|
||||||
<title>Goals</title>
|
<title>Goals</title>
|
||||||
<para>The &Boost.Threads; library has several goals that should help to set
|
<para>The &Boost.Thread; library has several goals that should help to set
|
||||||
it apart from other solutions. These goals are listed in order of precedence
|
it apart from other solutions. These goals are listed in order of precedence
|
||||||
with full descriptions below.
|
with full descriptions below.
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>Portability</term>
|
<term>Portability</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>&Boost.Threads; was designed to be highly portable. The goal is
|
<para>&Boost.Thread; was designed to be highly portable. The goal is
|
||||||
for the interface to be easily implemented on any platform that
|
for the interface to be easily implemented on any platform that
|
||||||
supports threads, and possibly even on platforms without native thread
|
supports threads, and possibly even on platforms without native thread
|
||||||
support.</para>
|
support.</para>
|
||||||
@@ -35,8 +39,8 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>Safety</term>
|
<term>Safety</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>&Boost.Threads; was designed to be as safe as possible. Writing
|
<para>&Boost.Thread; was designed to be as safe as possible. Writing
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link>
|
<link linkend="thread.glossary.thread-safe">thread-safe</link>
|
||||||
code is very difficult and successful libraries must strive to
|
code is very difficult and successful libraries must strive to
|
||||||
insulate the programmer from dangerous constructs as much as
|
insulate the programmer from dangerous constructs as much as
|
||||||
possible. This is accomplished in several ways:
|
possible. This is accomplished in several ways:
|
||||||
@@ -45,14 +49,14 @@
|
|||||||
<para>C++ language features are used to make correct usage easy
|
<para>C++ language features are used to make correct usage easy
|
||||||
(if possible) and error-prone usage impossible or at least more
|
(if possible) and error-prone usage impossible or at least more
|
||||||
difficult. For example, see the <link
|
difficult. For example, see the <link
|
||||||
linkend="threads.concepts.Mutex">Mutex</link> and <link
|
linkend="thread.concepts.Mutex">Mutex</link> and <link
|
||||||
linkend="threads.concepts.Lock">Lock</link> designs, and note
|
linkend="thread.concepts.Lock">Lock</link> designs, and note
|
||||||
how they interact.</para>
|
how they interact.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Certain traditional concurrent programming features are
|
<para>Certain traditional concurrent programming features are
|
||||||
considered so error-prone that they are not provided at all. For
|
considered so error-prone that they are not provided at all. For
|
||||||
example, see <xref linkend="threads.rationale.events" />.</para>
|
example, see <xref linkend="thread.rationale.events" />.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Dangerous features, or features which may be misused, are
|
<para>Dangerous features, or features which may be misused, are
|
||||||
@@ -65,9 +69,9 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>Flexibility</term>
|
<term>Flexibility</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>&Boost.Threads; was designed to be flexible. This goal is often
|
<para>&Boost.Thread; was designed to be flexible. This goal is often
|
||||||
at odds with <emphasis>safety</emphasis>. When functionality might be
|
at odds with <emphasis>safety</emphasis>. When functionality might be
|
||||||
compromised by the desire to keep the interface safe, &Boost.Threads;
|
compromised by the desire to keep the interface safe, &Boost.Thread;
|
||||||
has been designed to provide the functionality, but to make it's use
|
has been designed to provide the functionality, but to make it's use
|
||||||
prohibitive for general use. In other words, the interfaces have been
|
prohibitive for general use. In other words, the interfaces have been
|
||||||
designed such that it's usually obvious when something is unsafe, and
|
designed such that it's usually obvious when something is unsafe, and
|
||||||
@@ -77,11 +81,11 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>Efficiency</term>
|
<term>Efficiency</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>&Boost.Threads; was designed to be as efficient as
|
<para>&Boost.Thread; was designed to be as efficient as
|
||||||
possible. When building a library on top of another library there is
|
possible. When building a library on top of another library there is
|
||||||
always a danger that the result will be so much slower than the
|
always a danger that the result will be so much slower than the
|
||||||
"native" API that programmers are inclined to ignore the higher level
|
"native" API that programmers are inclined to ignore the higher level
|
||||||
API. &Boost.Threads; was designed to minimize the chances of this
|
API. &Boost.Thread; was designed to minimize the chances of this
|
||||||
occurring. The interfaces have been crafted to allow an implementation
|
occurring. The interfaces have been crafted to allow an implementation
|
||||||
the greatest chance of being as efficient as possible. This goal is
|
the greatest chance of being as efficient as possible. This goal is
|
||||||
often at odds with the goal for <emphasis>safety</emphasis>. Every
|
often at odds with the goal for <emphasis>safety</emphasis>. Every
|
||||||
@@ -94,18 +98,18 @@
|
|||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<title>Iterative Phases</title>
|
<title>Iterative Phases</title>
|
||||||
<para>Another goal of &Boost.Threads; was to take a dynamic, iterative
|
<para>Another goal of &Boost.Thread; was to take a dynamic, iterative
|
||||||
approach in its development. The computing industry is still exploring the
|
approach in its development. The computing industry is still exploring the
|
||||||
concepts of parallel programming. Most thread libraries supply only simple
|
concepts of parallel programming. Most thread libraries supply only simple
|
||||||
primitive concepts for thread synchronization. These concepts are very
|
primitive concepts for thread synchronization. These concepts are very
|
||||||
simple, but it is very difficult to use them safely or to provide formal
|
simple, but it is very difficult to use them safely or to provide formal
|
||||||
proofs for constructs built on top of them. There has been a lot of research
|
proofs for constructs built on top of them. There has been a lot of research
|
||||||
into other concepts, such as in "Communicating Sequential Processes."
|
into other concepts, such as in "Communicating Sequential Processes."
|
||||||
&Boost.Threads; was designed in iterative steps, with each step providing
|
&Boost.Thread; was designed in iterative steps, with each step providing
|
||||||
the building blocks necessary for the next step and giving the researcher
|
the building blocks necessary for the next step and giving the researcher
|
||||||
the tools necessary to explore new concepts in a portable manner.</para>
|
the tools necessary to explore new concepts in a portable manner.</para>
|
||||||
<para>Given the goal of following a dynamic, iterative approach
|
<para>Given the goal of following a dynamic, iterative approach
|
||||||
&Boost.Threads; shall go through several growth cycles. Each phase in its
|
&Boost.Thread; shall go through several growth cycles. Each phase in its
|
||||||
development shall be roughly documented here.</para>
|
development shall be roughly documented here.</para>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
@@ -119,10 +123,10 @@
|
|||||||
much help to a programmer who wants to use the library in his multithreaded
|
much help to a programmer who wants to use the library in his multithreaded
|
||||||
application. So there's a very great need for portable primitives that will
|
application. So there's a very great need for portable primitives that will
|
||||||
allow the library developer to create <link
|
allow the library developer to create <link
|
||||||
linkend="threads.glossary.thread-safe">thread-safe</link>
|
linkend="thread.glossary.thread-safe">thread-safe</link>
|
||||||
implementations. This need far out weighs the need for portable methods to
|
implementations. This need far out weighs the need for portable methods to
|
||||||
create and manage threads.</para>
|
create and manage threads.</para>
|
||||||
<para>Because of this need, the first phase of &Boost.Threads; focuses
|
<para>Because of this need, the first phase of &Boost.Thread; focuses
|
||||||
solely on providing portable primitive concepts for thread
|
solely on providing portable primitive concepts for thread
|
||||||
synchronization. Types provided in this phase include the
|
synchronization. Types provided in this phase include the
|
||||||
<classname>boost::mutex</classname>,
|
<classname>boost::mutex</classname>,
|
||||||
@@ -135,16 +139,16 @@
|
|||||||
synchronization primitives, though there are others that will be added in
|
synchronization primitives, though there are others that will be added in
|
||||||
later phases.</para>
|
later phases.</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.design.phase2">
|
<section id="thread.design.phase2">
|
||||||
<title>Phase 2, Thread Management and Thread Specific Storage</title>
|
<title>Phase 2, Thread Management and Thread Specific Storage</title>
|
||||||
<para>This phase addresses the creation and management of threads and
|
<para>This phase addresses the creation and management of threads and
|
||||||
provides a mechanism for thread specific storage (data associated with a
|
provides a mechanism for thread specific storage (data associated with a
|
||||||
thread instance). Thread management is a tricky issue in C++, so this
|
thread instance). Thread management is a tricky issue in C++, so this
|
||||||
phase addresses only the basic needs of multithreaded program. Later
|
phase addresses only the basic needs of multithreaded program. Later
|
||||||
phases are likely to add additional functionality in this area. This
|
phases are likely to add additional functionality in this area. This
|
||||||
phase of &Boost.Threads; adds the <classname>boost::thread</classname> and
|
phase of &Boost.Thread; adds the <classname>boost::thread</classname> and
|
||||||
<classname>boost::thread_specific_ptr</classname> types. With these
|
<classname>boost::thread_specific_ptr</classname> types. With these
|
||||||
additions the &Boost.Threads; library can be considered minimal but
|
additions the &Boost.Thread; library can be considered minimal but
|
||||||
complete.</para>
|
complete.</para>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
@@ -1,26 +1,30 @@
|
|||||||
<!ENTITY Boost.Threads "<emphasis role='bold'>Boost.Threads</emphasis>">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<!ENTITY Boost.Thread "<emphasis role='bold'>Boost.Thread</emphasis>">
|
||||||
<!ENTITY Boost.Build "<emphasis role='bold'>Boost.Build</emphasis>">
|
<!ENTITY Boost.Build "<emphasis role='bold'>Boost.Build</emphasis>">
|
||||||
<!ENTITY cite.AndrewsSchneider83 "<citation><xref
|
<!ENTITY cite.AndrewsSchneider83 "<citation><xref
|
||||||
linkend='threads.bib.AndrewsSchneider83'
|
linkend='thread.bib.AndrewsSchneider83'
|
||||||
endterm='threads.bib.AndrewsSchneider83.abbrev'/></citation>">
|
endterm='thread.bib.AndrewsSchneider83.abbrev'/></citation>">
|
||||||
<!ENTITY cite.Boost "<citation><xref linkend='threads.bib.Boost'
|
<!ENTITY cite.Boost "<citation><xref linkend='thread.bib.Boost'
|
||||||
endterm='threads.bib.Boost.abbrev'/></citation>">
|
endterm='thread.bib.Boost.abbrev'/></citation>">
|
||||||
<!ENTITY cite.Hansen73 "<citation><xref linkend='threads.bib.Hansen73'
|
<!ENTITY cite.Hansen73 "<citation><xref linkend='thread.bib.Hansen73'
|
||||||
endterm='threads.bib.Hansen73.abbrev'/></citation>">
|
endterm='thread.bib.Hansen73.abbrev'/></citation>">
|
||||||
<!ENTITY cite.Butenhof97 "<citation><xref linkend='threads.bib.Butenhof97'
|
<!ENTITY cite.Butenhof97 "<citation><xref linkend='thread.bib.Butenhof97'
|
||||||
endterm='threads.bib.Butenhof97.abbrev'/></citation>">
|
endterm='thread.bib.Butenhof97.abbrev'/></citation>">
|
||||||
<!ENTITY cite.Hoare74 "<citation><xref linkend='threads.bib.Hoare74'
|
<!ENTITY cite.Hoare74 "<citation><xref linkend='thread.bib.Hoare74'
|
||||||
endterm='threads.bib.Hoare74.abbrev'/></citation>">
|
endterm='thread.bib.Hoare74.abbrev'/></citation>">
|
||||||
<!ENTITY cite.ISO98 "<citation><xref linkend='threads.bib.ISO98'
|
<!ENTITY cite.ISO98 "<citation><xref linkend='thread.bib.ISO98'
|
||||||
endterm='threads.bib.ISO98.abbrev'/></citation>">
|
endterm='thread.bib.ISO98.abbrev'/></citation>">
|
||||||
<!ENTITY cite.McDowellHelmbold89 "<citation><xref
|
<!ENTITY cite.McDowellHelmbold89 "<citation><xref
|
||||||
linkend='threads.bib.McDowellHelmbold89'
|
linkend='thread.bib.McDowellHelmbold89'
|
||||||
endterm='threads.bib.McDowellHelmbold89.abbrev'/></citation>">
|
endterm='thread.bib.McDowellHelmbold89.abbrev'/></citation>">
|
||||||
<!ENTITY cite.SchmidtPyarali "<citation><xref
|
<!ENTITY cite.SchmidtPyarali "<citation><xref
|
||||||
linkend='threads.bib.SchmidtPyarali'
|
linkend='thread.bib.SchmidtPyarali'
|
||||||
endterm='threads.bib.SchmidtPyarali.abbrev'/></citation>">
|
endterm='thread.bib.SchmidtPyarali.abbrev'/></citation>">
|
||||||
<!ENTITY cite.SchmidtStalRohnertBuschmann "<citation><xref
|
<!ENTITY cite.SchmidtStalRohnertBuschmann "<citation><xref
|
||||||
linkend='threads.bib.SchmidtStalRohnertBuschmann'
|
linkend='thread.bib.SchmidtStalRohnertBuschmann'
|
||||||
endterm='threads.bib.SchmidtStalRohnertBuschmann.abbrev'/></citation>">
|
endterm='thread.bib.SchmidtStalRohnertBuschmann.abbrev'/></citation>">
|
||||||
<!ENTITY cite.Stroustrup "<citation><xref linkend='threads.bib.Stroustrup'
|
<!ENTITY cite.Stroustrup "<citation><xref linkend='thread.bib.Stroustrup'
|
||||||
endterm='threads.bib.Stroustrup.abbrev'/></citation>">
|
endterm='thread.bib.Stroustrup.abbrev'/></citation>">
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/exceptions.hpp"
|
<header name="boost/thread/exceptions.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -34,7 +38,7 @@
|
|||||||
<purpose>
|
<purpose>
|
||||||
<simpara>The <classname>thread_resource_error</classname> class
|
<simpara>The <classname>thread_resource_error</classname> class
|
||||||
defines an exception type that is thrown by constructors in the
|
defines an exception type that is thrown by constructors in the
|
||||||
&Boost.Threads; library when thread-related resources can not be
|
&Boost.Thread; library when thread-related resources can not be
|
||||||
acquired.</simpara>
|
acquired.</simpara>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
|
|||||||
65
doc/faq.xml
65
doc/faq.xml
@@ -1,45 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.faq" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.faq" last-revision="$Date$">
|
||||||
<title>Frequently Asked Questions</title>
|
<title>Frequently Asked Questions</title>
|
||||||
<qandaset>
|
<qandaset>
|
||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>Are lock objects <link
|
<para>Are lock objects <link
|
||||||
linkend="threads.glossary.thread-safe">thread safe</link>?</para>
|
linkend="thread.glossary.thread-safe">thread safe</link>?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para><emphasis role="bold">No!</emphasis> Lock objects are not meant to
|
<para><emphasis role="bold">No!</emphasis> Lock objects are not meant to
|
||||||
be shared between threads. They are meant to be short-lived objects
|
be shared between threads. They are meant to be short-lived objects
|
||||||
created on automatic storage within a code block. Any other usage is
|
created on automatic storage within a code block. Any other usage is
|
||||||
just likely to lead to errors and won't really be of actual benefit anyway.
|
just likely to lead to errors and won't really be of actual benefit anyway.
|
||||||
Share <link linkend="threads.concepts.mutexes">Mutexes</link>, not
|
Share <link linkend="thread.concepts.mutexes">Mutexes</link>, not
|
||||||
Locks. For more information see the <link
|
Locks. For more information see the <link
|
||||||
linkend="threads.rationale.locks">rationale</link> behind the
|
linkend="thread.rationale.locks">rationale</link> behind the
|
||||||
design for lock objects.</para>
|
design for lock objects.</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>Why was &Boost.Threads; modeled after (specific library
|
<para>Why was &Boost.Thread; modeled after (specific library
|
||||||
name)?</para>
|
name)?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para>It wasn't. &Boost.Threads; was designed from scratch. Extensive
|
<para>It wasn't. &Boost.Thread; was designed from scratch. Extensive
|
||||||
design discussions involved numerous people representing a wide range of
|
design discussions involved numerous people representing a wide range of
|
||||||
experience across many platforms. To ensure portability, the initial
|
experience across many platforms. To ensure portability, the initial
|
||||||
implements were done in parallel using POSIX Threads and the Win32
|
implements were done in parallel using POSIX Threads and the Win32
|
||||||
threading API. But the &Boost.Threads; design is very much in the spirit
|
threading API. But the &Boost.Thread; design is very much in the spirit
|
||||||
of C++, and thus doesn't model such C based APIs.</para>
|
of C++, and thus doesn't model such C based APIs.</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>Why wasn't &Boost.Threads; modeled after (specific library
|
<para>Why wasn't &Boost.Thread; modeled after (specific library
|
||||||
name)?</para>
|
name)?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
@@ -54,12 +58,12 @@
|
|||||||
</qandaentry>
|
</qandaentry>
|
||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>Why do <link linkend="threads.concepts.mutexes">Mutexes</link>
|
<para>Why do <link linkend="thread.concepts.mutexes">Mutexes</link>
|
||||||
have noncopyable semantics?</para>
|
have noncopyable semantics?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para>To ensure that <link
|
<para>To ensure that <link
|
||||||
linkend="threads.glossary.deadlock">deadlocks</link> don't occur. The
|
linkend="thread.glossary.deadlock">deadlocks</link> don't occur. The
|
||||||
only logical form of copy would be to use some sort of shallow copy
|
only logical form of copy would be to use some sort of shallow copy
|
||||||
semantics in which multiple mutex objects could refer to the same mutex
|
semantics in which multiple mutex objects could refer to the same mutex
|
||||||
state. This means that if ObjA has a mutex object as part of its state
|
state. This means that if ObjA has a mutex object as part of its state
|
||||||
@@ -73,20 +77,20 @@
|
|||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>How can you prevent <link
|
<para>How can you prevent <link
|
||||||
linkend="threads.glossary.deadlock">deadlock</link> from occurring when
|
linkend="thread.glossary.deadlock">deadlock</link> from occurring when
|
||||||
a thread must lock multiple mutexes?</para>
|
a thread must lock multiple mutexes?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para>Always lock them in the same order. One easy way of doing this is
|
<para>Always lock them in the same order. One easy way of doing this is
|
||||||
to use each mutex's address to determine the order in which they are
|
to use each mutex's address to determine the order in which they are
|
||||||
locked. A future &Boost.Threads; concept may wrap this pattern up in a
|
locked. A future &Boost.Thread; concept may wrap this pattern up in a
|
||||||
reusable class.</para>
|
reusable class.</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>Don't noncopyable <link
|
<para>Don't noncopyable <link
|
||||||
linkend="threads.concepts.mutexes">Mutex</link> semantics mean that a
|
linkend="thread.concepts.mutexes">Mutex</link> semantics mean that a
|
||||||
class with a mutex member will be noncopyable as well?</para>
|
class with a mutex member will be noncopyable as well?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
@@ -94,7 +98,7 @@
|
|||||||
copy constructor and assignment operator, so they will have to be coded
|
copy constructor and assignment operator, so they will have to be coded
|
||||||
explicitly. This is a <emphasis role="bold">good thing</emphasis>,
|
explicitly. This is a <emphasis role="bold">good thing</emphasis>,
|
||||||
however, since the compiler generated operations would not be <link
|
however, since the compiler generated operations would not be <link
|
||||||
linkend="threads.glossary.thread-safe">thread-safe</link>. The following
|
linkend="thread.glossary.thread-safe">thread-safe</link>. The following
|
||||||
is a simple example of a class with copyable semantics and internal
|
is a simple example of a class with copyable semantics and internal
|
||||||
synchronization through a mutex member.</para>
|
synchronization through a mutex member.</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -144,7 +148,7 @@ private:
|
|||||||
<qandaentry>
|
<qandaentry>
|
||||||
<question>
|
<question>
|
||||||
<para>How can you lock a <link
|
<para>How can you lock a <link
|
||||||
linkend="threads.concepts.mutexes">Mutex</link> member in a const member
|
linkend="thread.concepts.mutexes">Mutex</link> member in a const member
|
||||||
function, in order to implement the Monitor Pattern?</para>
|
function, in order to implement the Monitor Pattern?</para>
|
||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
@@ -165,8 +169,8 @@ private:
|
|||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para>Condition variables result in user code much less prone to <link
|
<para>Condition variables result in user code much less prone to <link
|
||||||
linkend="threads.glossary.race-condition">race conditions</link> than
|
linkend="thread.glossary.race-condition">race conditions</link> than
|
||||||
event variables. See <xref linkend="threads.rationale.events" />
|
event variables. See <xref linkend="thread.rationale.events" />
|
||||||
for analysis. Also see &cite.Hoare74; and &cite.SchmidtStalRohnertBuschmann;.
|
for analysis. Also see &cite.Hoare74; and &cite.SchmidtStalRohnertBuschmann;.
|
||||||
</para>
|
</para>
|
||||||
</answer>
|
</answer>
|
||||||
@@ -177,7 +181,7 @@ private:
|
|||||||
</question>
|
</question>
|
||||||
<answer>
|
<answer>
|
||||||
<para>There's a valid need for thread termination, so at some point
|
<para>There's a valid need for thread termination, so at some point
|
||||||
&Boost.Threads; probably will include it, but only after we can find a
|
&Boost.Thread; probably will include it, but only after we can find a
|
||||||
truly safe (and portable) mechanism for this concept.</para>
|
truly safe (and portable) mechanism for this concept.</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
@@ -206,5 +210,26 @@ private:
|
|||||||
condition variable.</para>
|
condition variable.</para>
|
||||||
</answer>
|
</answer>
|
||||||
</qandaentry>
|
</qandaentry>
|
||||||
|
<qandaentry>
|
||||||
|
<question>
|
||||||
|
<para>Why doesn't the thread's ctor take at least a void* to pass any
|
||||||
|
information along with the function? All other threading libs support
|
||||||
|
that and it makes Boost.Threads inferiour. </para>
|
||||||
|
</question>
|
||||||
|
<answer>
|
||||||
|
<para>There is no need, because Boost.Threads are superiour! First
|
||||||
|
thing is that its ctor doesn't take a function but a functor. That
|
||||||
|
means that you can pass an object with an overloaded operator() and
|
||||||
|
include additional data as members in that object. Beware though that
|
||||||
|
this object is copied, use boost::ref to prevent that. Secondly, even
|
||||||
|
a boost::function<void (void)> can carry parameters, you only have to
|
||||||
|
use boost::bind() to create it from any function and bind its
|
||||||
|
parameters.</para>
|
||||||
|
<para>That is also why Boost.Threads are superiour, because they
|
||||||
|
don't require you to pass a type-unsafe void pointer. Rather, you can
|
||||||
|
use the flexible Boost.Functions to create a thread entry out of
|
||||||
|
anything that can be called.</para>
|
||||||
|
</answer>
|
||||||
|
</qandaentry>
|
||||||
</qandaset>
|
</qandaset>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<glossary id="threads.glossary" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<glossary id="thread.glossary" last-revision="$Date$">
|
||||||
<title>Glossary</title>
|
<title>Glossary</title>
|
||||||
<para>Definitions are given in terms of the C++ Standard
|
<para>Definitions are given in terms of the C++ Standard
|
||||||
&cite.ISO98;. References to the standard are in the form [1.2.3/4], which
|
&cite.ISO98;. References to the standard are in the form [1.2.3/4], which
|
||||||
@@ -12,9 +16,9 @@
|
|||||||
"/".</para>
|
"/".</para>
|
||||||
<para>Because the definitions are written in something akin to "standardese",
|
<para>Because the definitions are written in something akin to "standardese",
|
||||||
they can be difficult to understand. The intent isn't to confuse, but rather
|
they can be difficult to understand. The intent isn't to confuse, but rather
|
||||||
to clarify the additional requirements &Boost.Threads; places on a C++
|
to clarify the additional requirements &Boost.Thread; places on a C++
|
||||||
implementation as defined by the C++ Standard.</para>
|
implementation as defined by the C++ Standard.</para>
|
||||||
<glossentry id="threads.glossary.thread">
|
<glossentry id="thread.glossary.thread">
|
||||||
<glossterm>Thread</glossterm>
|
<glossterm>Thread</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>Thread is short for "thread of execution". A thread of execution is
|
<para>Thread is short for "thread of execution". A thread of execution is
|
||||||
@@ -50,13 +54,13 @@
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.thread-safe">
|
<glossentry id="thread.glossary.thread-safe">
|
||||||
<glossterm>Thread-safe</glossterm>
|
<glossterm>Thread-safe</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>A program is thread-safe if it has no <link
|
<para>A program is thread-safe if it has no <link
|
||||||
linkend="threads.glossary.race-condition">race conditions</link>, does
|
linkend="thread.glossary.race-condition">race conditions</link>, does
|
||||||
not <link linkend="threads.glossary.deadlock">deadlock</link>, and has
|
not <link linkend="thread.glossary.deadlock">deadlock</link>, and has
|
||||||
no <link linkend="threads.glossary.priority-failure">priority
|
no <link linkend="thread.glossary.priority-failure">priority
|
||||||
failures</link>.</para>
|
failures</link>.</para>
|
||||||
<para>Note that thread-safety does not necessarily imply efficiency, and
|
<para>Note that thread-safety does not necessarily imply efficiency, and
|
||||||
than while some thread-safety violations can be determined statically at
|
than while some thread-safety violations can be determined statically at
|
||||||
@@ -64,7 +68,7 @@
|
|||||||
runtime.</para>
|
runtime.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.thread-state">
|
<glossentry id="thread.glossary.thread-state">
|
||||||
<glossterm>Thread State</glossterm>
|
<glossterm>Thread State</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>During the lifetime of a thread, it shall be in one of the following
|
<para>During the lifetime of a thread, it shall be in one of the following
|
||||||
@@ -166,7 +170,7 @@
|
|||||||
above table.]</para>
|
above table.]</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.race-condition">
|
<glossentry id="thread.glossary.race-condition">
|
||||||
<glossterm>Race Condition</glossterm>
|
<glossterm>Race Condition</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>A race condition is what occurs when multiple threads read from and write
|
<para>A race condition is what occurs when multiple threads read from and write
|
||||||
@@ -175,10 +179,10 @@
|
|||||||
pattern which isn't even a valid value for the data type. A race condition
|
pattern which isn't even a valid value for the data type. A race condition
|
||||||
results in undefined behavior [1.3.12].</para>
|
results in undefined behavior [1.3.12].</para>
|
||||||
<para>Race conditions can be prevented by serializing memory access using
|
<para>Race conditions can be prevented by serializing memory access using
|
||||||
the tools provided by &Boost.Threads;.</para>
|
the tools provided by &Boost.Thread;.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.deadlock">
|
<glossentry id="thread.glossary.deadlock">
|
||||||
<glossterm>Deadlock</glossterm>
|
<glossterm>Deadlock</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>Deadlock is an execution state where for some set of threads, each
|
<para>Deadlock is an execution state where for some set of threads, each
|
||||||
@@ -187,14 +191,14 @@
|
|||||||
become ready again.</para>
|
become ready again.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.starvation">
|
<glossentry id="thread.glossary.starvation">
|
||||||
<glossterm>Starvation</glossterm>
|
<glossterm>Starvation</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>The condition in which a thread is not making sufficient progress in
|
<para>The condition in which a thread is not making sufficient progress in
|
||||||
its work during a given time interval.</para>
|
its work during a given time interval.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.priority-failure">
|
<glossentry id="thread.glossary.priority-failure">
|
||||||
<glossterm>Priority Failure</glossterm>
|
<glossterm>Priority Failure</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>A priority failure (such as priority inversion or infinite overtaking)
|
<para>A priority failure (such as priority inversion or infinite overtaking)
|
||||||
@@ -202,10 +206,10 @@
|
|||||||
performed in time to be useful.</para>
|
performed in time to be useful.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.undefined-behavior">
|
<glossentry id="thread.glossary.undefined-behavior">
|
||||||
<glossterm>Undefined Behavior</glossterm>
|
<glossterm>Undefined Behavior</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>The result of certain operations in &Boost.Threads; is undefined;
|
<para>The result of certain operations in &Boost.Thread; is undefined;
|
||||||
this means that those operations can invoke almost any behavior when
|
this means that those operations can invoke almost any behavior when
|
||||||
they are executed.</para>
|
they are executed.</para>
|
||||||
|
|
||||||
@@ -220,7 +224,7 @@
|
|||||||
programming error.</para>
|
programming error.</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
<glossentry id="threads.glossary.memory-visibility">
|
<glossentry id="thread.glossary.memory-visibility">
|
||||||
<glossterm>Memory Visibility</glossterm>
|
<glossterm>Memory Visibility</glossterm>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para>An address [1.7] shall always point to the same memory byte,
|
<para>An address [1.7] shall always point to the same memory byte,
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.implementation_notes" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.implementation_notes" last-revision="$Date$">
|
||||||
<title>Implementation Notes</title>
|
<title>Implementation Notes</title>
|
||||||
<section id="threads.implementation_notes.win32">
|
<section id="thread.implementation_notes.win32">
|
||||||
<title>Win32</title>
|
<title>Win32</title>
|
||||||
<para>
|
<para>
|
||||||
In the current Win32 implementation, creating a boost::thread object
|
In the current Win32 implementation, creating a boost::thread object
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
|
<!-- Copyright (c) 2002-2003 Beman Dawes, William E. Kempf.
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="refresh" content="0; URL=../../../doc/html/threads.html">
|
<meta http-equiv="refresh" content="0; URL=../../../doc/html/thread.html">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
Automatic redirection failed, please go to <a href="../../../doc/html/threads.html">../../../doc/html/threads.html</a>
|
Automatic redirection failed, please go to <a href="../../../doc/html/thread.html">../../../doc/html/thread.html</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,35 +1,39 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/mutex.hpp"
|
<header name="boost/thread/mutex.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
<class name="mutex">
|
<class name="mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>mutex</classname> class is a model of the
|
<para>The <classname>mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.Mutex">Mutex</link> concept.</para>
|
<link linkend="thread.concepts.Mutex">Mutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>mutex</classname> class is a model of the
|
<para>The <classname>mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.Mutex">Mutex</link> concept.
|
<link linkend="thread.concepts.Mutex">Mutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>try_mutex</classname> and <classname>timed_mutex</classname>.</para>
|
<classname>try_mutex</classname> and <classname>timed_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<para>For <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics, see <classname>recursive_mutex</classname>,
|
locking mechanics, see <classname>recursive_mutex</classname>,
|
||||||
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>mutex</classname> class supplies the following typedef,
|
<para>The <classname>mutex</classname> class supplies the following typedef,
|
||||||
which <link linkend="threads.concepts.lock-models">models</link>
|
which <link linkend="thread.concepts.lock-models">models</link>
|
||||||
the specified locking strategy:
|
the specified locking strategy:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -43,7 +47,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -51,7 +55,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>mutex</classname> class uses an
|
<para>The <classname>mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -61,10 +65,10 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>mutex</classname> leaves the
|
in &Boost.Thread;, <classname>mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -100,26 +104,26 @@
|
|||||||
<class name="try_mutex">
|
<class name="try_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>try_mutex</classname> class is a model of the
|
<para>The <classname>try_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryMutex">TryMutex</link> concept.</para>
|
<link linkend="thread.concepts.TryMutex">TryMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>try_mutex</classname> class is a model of the
|
<para>The <classname>try_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryMutex">TryMutex</link> concept.
|
<link linkend="thread.concepts.TryMutex">TryMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>mutex</classname> and <classname>timed_mutex</classname>.</para>
|
<classname>mutex</classname> and <classname>timed_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<para>For <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics, see <classname>recursive_mutex</classname>,
|
locking mechanics, see <classname>recursive_mutex</classname>,
|
||||||
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>try_mutex</classname> class supplies the following typedefs,
|
<para>The <classname>try_mutex</classname> class supplies the following typedefs,
|
||||||
which <link linkend="threads.concepts.lock-models">model</link>
|
which <link linkend="thread.concepts.lock-models">model</link>
|
||||||
the specified locking strategies:
|
the specified locking strategies:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -133,11 +137,11 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_lock</entry>
|
<entry>scoped_try_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -145,7 +149,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>try_mutex</classname> class uses an
|
<para>The <classname>try_mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>try_mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>try_mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -155,10 +159,10 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>try_mutex</classname> leaves the
|
in &Boost.Thread;, <classname>try_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -199,26 +203,26 @@
|
|||||||
<class name="timed_mutex">
|
<class name="timed_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>timed_mutex</classname> class is a model of the
|
<para>The <classname>timed_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedMutex">TimedMutex</link> concept.</para>
|
<link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>timed_mutex</classname> class is a model of the
|
<para>The <classname>timed_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedMutex">TimedMutex</link> concept.
|
<link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>mutex</classname> and <classname>try_mutex</classname>.</para>
|
<classname>mutex</classname> and <classname>try_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<para>For <link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics, see <classname>recursive_mutex</classname>,
|
locking mechanics, see <classname>recursive_mutex</classname>,
|
||||||
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
<classname>recursive_try_mutex</classname>, and <classname>recursive_timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>timed_mutex</classname> class supplies the following typedefs,
|
<para>The <classname>timed_mutex</classname> class supplies the following typedefs,
|
||||||
which <link linkend="threads.concepts.lock-models">model</link>
|
which <link linkend="thread.concepts.lock-models">model</link>
|
||||||
the specified locking strategies:
|
the specified locking strategies:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -232,15 +236,15 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_lock</entry>
|
<entry>scoped_try_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_timed_lock</entry>
|
<entry>scoped_timed_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -248,7 +252,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>timed_mutex</classname> class uses an
|
<para>The <classname>timed_mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>timed_mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>timed_mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -258,10 +262,10 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>timed_mutex</classname> leaves the
|
in &Boost.Thread;, <classname>timed_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/once.hpp"
|
<header name="boost/thread/once.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<macro name="BOOST_ONCE_INIT">
|
<macro name="BOOST_ONCE_INIT">
|
||||||
@@ -11,7 +15,7 @@
|
|||||||
<code>once_flag</code> type (statically initialized to
|
<code>once_flag</code> type (statically initialized to
|
||||||
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
||||||
routine exactly once. This can be used to initialize data in a
|
routine exactly once. This can be used to initialize data in a
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link>
|
<link linkend="thread.glossary.thread-safe">thread-safe</link>
|
||||||
manner.</purpose>
|
manner.</purpose>
|
||||||
|
|
||||||
<description>The implementation-defined macro
|
<description>The implementation-defined macro
|
||||||
@@ -27,7 +31,7 @@
|
|||||||
<code>once_flag</code> type (statically initialized to
|
<code>once_flag</code> type (statically initialized to
|
||||||
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
||||||
routine exactly once. This can be used to initialize data in a
|
routine exactly once. This can be used to initialize data in a
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link>
|
<link linkend="thread.glossary.thread-safe">thread-safe</link>
|
||||||
manner.</purpose>
|
manner.</purpose>
|
||||||
|
|
||||||
<description>The implementation-defined type <code>once_flag</code>
|
<description>The implementation-defined type <code>once_flag</code>
|
||||||
@@ -45,7 +49,7 @@
|
|||||||
<code>once_flag</code> type (statically initialized to
|
<code>once_flag</code> type (statically initialized to
|
||||||
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
<macroname>BOOST_ONCE_INIT</macroname>) can be used to run a
|
||||||
routine exactly once. This can be used to initialize data in a
|
routine exactly once. This can be used to initialize data in a
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link>
|
<link linkend="thread.glossary.thread-safe">thread-safe</link>
|
||||||
manner.</purpose>
|
manner.</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.overview" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.overview" last-revision="$Date$">
|
||||||
<title>Overview</title>
|
<title>Overview</title>
|
||||||
<section id="threads.introduction">
|
<section id="thread.introduction">
|
||||||
<title>Introduction</title>
|
<title>Introduction</title>
|
||||||
<para>&Boost.Threads; allows C++ programs to execute as multiple,
|
<para>&Boost.Thread; allows C++ programs to execute as multiple,
|
||||||
asynchronous, independent threads-of-execution. Each thread has its own
|
asynchronous, independent threads-of-execution. Each thread has its own
|
||||||
machine state including program instruction counter and registers. Programs
|
machine state including program instruction counter and registers. Programs
|
||||||
which execute as multiple threads are called multithreaded programs to
|
which execute as multiple threads are called multithreaded programs to
|
||||||
distinguish them from traditional single-threaded programs. The <link
|
distinguish them from traditional single-threaded programs. The <link
|
||||||
linkend="threads.glossary">glossary</link> gives a more complete description
|
linkend="thread.glossary">glossary</link> gives a more complete description
|
||||||
of the multithreading execution environment.</para>
|
of the multithreading execution environment.</para>
|
||||||
<para>Multithreading provides several advantages:
|
<para>Multithreading provides several advantages:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
@@ -44,15 +48,15 @@
|
|||||||
multithreaded programs are subject to additional errors:
|
multithreaded programs are subject to additional errors:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><link linkend="threads.glossary.race-condition">Race
|
<para><link linkend="thread.glossary.race-condition">Race
|
||||||
conditions</link></para>
|
conditions</link></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><link linkend="threads.glossary.deadlock">Deadlock</link>
|
<para><link linkend="thread.glossary.deadlock">Deadlock</link>
|
||||||
(sometimes called "deadly embrace")</para>
|
(sometimes called "deadly embrace")</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><link linkend="threads.glossary.priority-failure">Priority
|
<para><link linkend="thread.glossary.priority-failure">Priority
|
||||||
failures</link> (priority inversion, infinite overtaking, starvation,
|
failures</link> (priority inversion, infinite overtaking, starvation,
|
||||||
etc.)</para>
|
etc.)</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -61,10 +65,10 @@
|
|||||||
errors. These aren't rare or exotic failures - they are virtually guaranteed
|
errors. These aren't rare or exotic failures - they are virtually guaranteed
|
||||||
to occur unless multithreaded code is designed to avoid them. Priority
|
to occur unless multithreaded code is designed to avoid them. Priority
|
||||||
failures are somewhat less common, but are nonetheless serious.</para>
|
failures are somewhat less common, but are nonetheless serious.</para>
|
||||||
<para>The <link linkend="threads.design">&Boost.Threads; design</link>
|
<para>The <link linkend="thread.design">&Boost.Thread; design</link>
|
||||||
attempts to minimize these errors, but they will still occur unless the
|
attempts to minimize these errors, but they will still occur unless the
|
||||||
programmer proactively designs to avoid them.</para>
|
programmer proactively designs to avoid them.</para>
|
||||||
<note>Please also see <xref linkend="threads.implementation_notes"/>
|
<note>Please also see <xref linkend="thread.implementation_notes"/>
|
||||||
for additional, implementation-specific considerations.</note>
|
for additional, implementation-specific considerations.</note>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
@@ -119,11 +123,11 @@
|
|||||||
<title>Runtime libraries</title>
|
<title>Runtime libraries</title>
|
||||||
<para>
|
<para>
|
||||||
<emphasis role="bold">Warning:</emphasis> Multithreaded programs such as
|
<emphasis role="bold">Warning:</emphasis> Multithreaded programs such as
|
||||||
those using &Boost.Threads; must link to <link
|
those using &Boost.Thread; must link to <link
|
||||||
linkend="threads.glossary.thread-safe">thread-safe</link> versions of
|
linkend="thread.glossary.thread-safe">thread-safe</link> versions of
|
||||||
all runtime libraries used by the program, including the runtime library
|
all runtime libraries used by the program, including the runtime library
|
||||||
for the C++ Standard Library. Failure to do so will cause <link
|
for the C++ Standard Library. Failure to do so will cause <link
|
||||||
linkend="threads.glossary.race-condition">race conditions</link> to occur
|
linkend="thread.glossary.race-condition">race conditions</link> to occur
|
||||||
when multiple threads simultaneously execute runtime library functions for
|
when multiple threads simultaneously execute runtime library functions for
|
||||||
<code>new</code>, <code>delete</code>, or other language features which
|
<code>new</code>, <code>delete</code>, or other language features which
|
||||||
imply shared state.</para>
|
imply shared state.</para>
|
||||||
@@ -169,15 +173,15 @@
|
|||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<title>Common guarantees for all &Boost.Threads; components</title>
|
<title>Common guarantees for all &Boost.Thread; components</title>
|
||||||
<section>
|
<section>
|
||||||
<title>Exceptions</title>
|
<title>Exceptions</title>
|
||||||
<para>&Boost.Threads; destructors never
|
<para>&Boost.Thread; destructors never
|
||||||
throw exceptions. Unless otherwise specified, other
|
throw exceptions. Unless otherwise specified, other
|
||||||
&Boost.Threads; functions that do not have
|
&Boost.Thread; functions that do not have
|
||||||
an exception-specification may throw implementation-defined
|
an exception-specification may throw implementation-defined
|
||||||
exceptions.</para>
|
exceptions.</para>
|
||||||
<para>In particular, &Boost.Threads;
|
<para>In particular, &Boost.Thread;
|
||||||
reports failure to allocate storage by throwing an exception of type
|
reports failure to allocate storage by throwing an exception of type
|
||||||
<code>std::bad_alloc</code> or a class derived from
|
<code>std::bad_alloc</code> or a class derived from
|
||||||
<code>std::bad_alloc</code>, failure to obtain thread resources other than
|
<code>std::bad_alloc</code>, failure to obtain thread resources other than
|
||||||
@@ -191,7 +195,7 @@
|
|||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<title>NonCopyable requirement</title>
|
<title>NonCopyable requirement</title>
|
||||||
<para>&Boost.Threads; classes documented as
|
<para>&Boost.Thread; classes documented as
|
||||||
meeting the NonCopyable requirement disallow copy construction and copy
|
meeting the NonCopyable requirement disallow copy construction and copy
|
||||||
assignment. For the sake of exposition, the synopsis of such classes show
|
assignment. For the sake of exposition, the synopsis of such classes show
|
||||||
private derivation from <classname>boost::noncopyable</classname>. Users
|
private derivation from <classname>boost::noncopyable</classname>. Users
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.rationale" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.rationale" last-revision="$Date$">
|
||||||
<title>Rationale</title>
|
<title>Rationale</title>
|
||||||
<para>This page explains the rationale behind various design decisions in the
|
<para>This page explains the rationale behind various design decisions in the
|
||||||
&Boost.Threads; library. Having the rationale documented here should explain
|
&Boost.Thread; library. Having the rationale documented here should explain
|
||||||
how we arrived at the current design as well as prevent future rehashing of
|
how we arrived at the current design as well as prevent future rehashing of
|
||||||
discussions and thought processes that have already occurred. It can also give
|
discussions and thought processes that have already occurred. It can also give
|
||||||
users a lot of insight into the design process required for this
|
users a lot of insight into the design process required for this
|
||||||
library.</para>
|
library.</para>
|
||||||
<section id="threads.rationale.Boost.Threads">
|
<section id="thread.rationale.Boost.Thread">
|
||||||
<title>Rationale for the Creation of &Boost.Threads;</title>
|
<title>Rationale for the Creation of &Boost.Thread;</title>
|
||||||
<para>Processes often have a degree of "potential parallelism" and it can
|
<para>Processes often have a degree of "potential parallelism" and it can
|
||||||
often be more intuitive to design systems with this in mind. Further, these
|
often be more intuitive to design systems with this in mind. Further, these
|
||||||
parallel processes can result in more responsive programs. The benefits for
|
parallel processes can result in more responsive programs. The benefits for
|
||||||
@@ -33,24 +37,24 @@
|
|||||||
<para>What's truly needed is C++ language support for threads. However, the
|
<para>What's truly needed is C++ language support for threads. However, the
|
||||||
C++ standards committee needs existing practice or a good proposal as a
|
C++ standards committee needs existing practice or a good proposal as a
|
||||||
starting point for adding this to the standard.</para>
|
starting point for adding this to the standard.</para>
|
||||||
<para>The &Boost.Threads; library was developed to provide a C++ developer
|
<para>The &Boost.Thread; library was developed to provide a C++ developer
|
||||||
with a portable interface for writing multithreaded programs on numerous
|
with a portable interface for writing multithreaded programs on numerous
|
||||||
platforms. There's a hope that the library can be the basis for a more
|
platforms. There's a hope that the library can be the basis for a more
|
||||||
detailed proposal for the C++ standards committee to consider for inclusion
|
detailed proposal for the C++ standards committee to consider for inclusion
|
||||||
in the next C++ standard.</para>
|
in the next C++ standard.</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.primitives">
|
<section id="thread.rationale.primitives">
|
||||||
<title>Rationale for the Low Level Primitives Supported in &Boost.Threads;</title>
|
<title>Rationale for the Low Level Primitives Supported in &Boost.Thread;</title>
|
||||||
<para>The &Boost.Threads; library supplies a set of low level primitives for
|
<para>The &Boost.Thread; library supplies a set of low level primitives for
|
||||||
writing multithreaded programs, such as mutexes and condition variables. In
|
writing multithreaded programs, such as mutexes and condition variables. In
|
||||||
fact, the first release of &Boost.Threads; supports only these low level
|
fact, the first release of &Boost.Thread; supports only these low level
|
||||||
primitives. However, computer science research has shown that use of these
|
primitives. However, computer science research has shown that use of these
|
||||||
primitives is difficult since it's difficult to mathematically prove that a
|
primitives is difficult since it's difficult to mathematically prove that a
|
||||||
usage pattern is correct, meaning it doesn't result in race conditions or
|
usage pattern is correct, meaning it doesn't result in race conditions or
|
||||||
deadlocks. There are several algebras (such as CSP, CCS and Join calculus)
|
deadlocks. There are several algebras (such as CSP, CCS and Join calculus)
|
||||||
that have been developed to help write provably correct parallel
|
that have been developed to help write provably correct parallel
|
||||||
processes. In order to prove the correctness these processes must be coded
|
processes. In order to prove the correctness these processes must be coded
|
||||||
using higher level abstractions. So why does &Boost.Threads; support the
|
using higher level abstractions. So why does &Boost.Thread; support the
|
||||||
lower level concepts?</para>
|
lower level concepts?</para>
|
||||||
<para>The reason is simple: the higher level concepts need to be implemented
|
<para>The reason is simple: the higher level concepts need to be implemented
|
||||||
using at least some of the lower level concepts. So having portable lower
|
using at least some of the lower level concepts. So having portable lower
|
||||||
@@ -64,11 +68,11 @@
|
|||||||
level concepts, supporting the lower level concepts provides
|
level concepts, supporting the lower level concepts provides
|
||||||
greater accessibility.</para>
|
greater accessibility.</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.locks">
|
<section id="thread.rationale.locks">
|
||||||
<title>Rationale for the Lock Design</title>
|
<title>Rationale for the Lock Design</title>
|
||||||
<para>Programmers who are used to multithreaded programming issues will
|
<para>Programmers who are used to multithreaded programming issues will
|
||||||
quickly note that the &Boost.Threads; design for mutex lock concepts is not
|
quickly note that the &Boost.Thread; design for mutex lock concepts is not
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link> (this is
|
<link linkend="thread.glossary.thread-safe">thread-safe</link> (this is
|
||||||
clearly documented as well). At first this may seem like a serious design
|
clearly documented as well). At first this may seem like a serious design
|
||||||
flaw. Why have a multithreading primitive that's not thread-safe
|
flaw. Why have a multithreading primitive that's not thread-safe
|
||||||
itself?</para>
|
itself?</para>
|
||||||
@@ -91,17 +95,17 @@
|
|||||||
since checking the state can occur only by a call after construction, we'd
|
since checking the state can occur only by a call after construction, we'd
|
||||||
have a race condition if the lock object were shared between threads.</para>
|
have a race condition if the lock object were shared between threads.</para>
|
||||||
<para>So, to avoid the overhead of synchronizing access to the state
|
<para>So, to avoid the overhead of synchronizing access to the state
|
||||||
information and to avoid the race condition, the &Boost.Threads; library
|
information and to avoid the race condition, the &Boost.Thread; library
|
||||||
simply does nothing to make lock objects thread-safe. Instead, sharing a
|
simply does nothing to make lock objects thread-safe. Instead, sharing a
|
||||||
lock object between threads results in undefined behavior. Since the only
|
lock object between threads results in undefined behavior. Since the only
|
||||||
proper usage of lock objects is within block scope this isn't a problem, and
|
proper usage of lock objects is within block scope this isn't a problem, and
|
||||||
so long as the lock object is properly used there's no danger of any
|
so long as the lock object is properly used there's no danger of any
|
||||||
multithreading issues.</para>
|
multithreading issues.</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable">
|
<section id="thread.rationale.non-copyable">
|
||||||
<title>Rationale for NonCopyable Thread Type</title>
|
<title>Rationale for NonCopyable Thread Type</title>
|
||||||
<para>Programmers who are used to C libraries for multithreaded programming
|
<para>Programmers who are used to C libraries for multithreaded programming
|
||||||
are likely to wonder why &Boost.Threads; uses a noncopyable design for
|
are likely to wonder why &Boost.Thread; uses a noncopyable design for
|
||||||
<classname>boost::thread</classname>. After all, the C thread types are
|
<classname>boost::thread</classname>. After all, the C thread types are
|
||||||
copyable, and you often have a need for copying them within user
|
copyable, and you often have a need for copying them within user
|
||||||
code. However, careful comparison of C designs to C++ designs shows a flaw
|
code. However, careful comparison of C designs to C++ designs shows a flaw
|
||||||
@@ -137,7 +141,7 @@
|
|||||||
appear to bear them out. To illustrate the analysis we'll first provide
|
appear to bear them out. To illustrate the analysis we'll first provide
|
||||||
pseudo-code illustrating the six typical usage patterns of a thread
|
pseudo-code illustrating the six typical usage patterns of a thread
|
||||||
object.</para>
|
object.</para>
|
||||||
<section id="threads.rationale.non-copyable.simple">
|
<section id="thread.rationale.non-copyable.simple">
|
||||||
<title>1. Use case: Simple creation of a thread.</title>
|
<title>1. Use case: Simple creation of a thread.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -146,7 +150,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable.joined">
|
<section id="thread.rationale.non-copyable.joined">
|
||||||
<title>2. Use case: Creation of a thread that's later joined.</title>
|
<title>2. Use case: Creation of a thread that's later joined.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -156,7 +160,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable.loop">
|
<section id="thread.rationale.non-copyable.loop">
|
||||||
<title>3. Use case: Simple creation of several threads in a loop.</title>
|
<title>3. Use case: Simple creation of several threads in a loop.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -166,7 +170,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable.loop-join">
|
<section id="thread.rationale.non-copyable.loop-join">
|
||||||
<title>4. Use case: Creation of several threads in a loop which are later joined.</title>
|
<title>4. Use case: Creation of several threads in a loop which are later joined.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -178,7 +182,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable.pass">
|
<section id="thread.rationale.non-copyable.pass">
|
||||||
<title>5. Use case: Creation of a thread whose ownership is passed to another object/method.</title>
|
<title>5. Use case: Creation of a thread whose ownership is passed to another object/method.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -188,7 +192,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.non-copyable.shared">
|
<section id="thread.rationale.non-copyable.shared">
|
||||||
<title>6. Use case: Creation of a thread whose ownership is shared between multiple
|
<title>6. Use case: Creation of a thread whose ownership is shared between multiple
|
||||||
objects.</title>
|
objects.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -221,7 +225,7 @@
|
|||||||
use a concept for any of the usage patterns there would be a good argument
|
use a concept for any of the usage patterns there would be a good argument
|
||||||
for choosing the other design. So we'll code all six usage patterns using
|
for choosing the other design. So we'll code all six usage patterns using
|
||||||
both designs.</para>
|
both designs.</para>
|
||||||
<section id="threads.rationale_comparison.non-copyable.simple">
|
<section id="thread.rationale_comparison.non-copyable.simple">
|
||||||
<title>1. Comparison: simple creation of a thread.</title>
|
<title>1. Comparison: simple creation of a thread.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -234,7 +238,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale_comparison.non-copyable.joined">
|
<section id="thread.rationale_comparison.non-copyable.joined">
|
||||||
<title>2. Comparison: creation of a thread that's later joined.</title>
|
<title>2. Comparison: creation of a thread that's later joined.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -249,7 +253,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale_comparison.non-copyable.loop">
|
<section id="thread.rationale_comparison.non-copyable.loop">
|
||||||
<title>3. Comparison: simple creation of several threads in a loop.</title>
|
<title>3. Comparison: simple creation of several threads in a loop.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -264,7 +268,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale_comparison.non-copyable.loop-join">
|
<section id="thread.rationale_comparison.non-copyable.loop-join">
|
||||||
<title>4. Comparison: creation of several threads in a loop which are later joined.</title>
|
<title>4. Comparison: creation of several threads in a loop which are later joined.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -285,7 +289,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale_comparison.non-copyable.pass">
|
<section id="thread.rationale_comparison.non-copyable.pass">
|
||||||
<title>5. Comparison: creation of a thread whose ownership is passed to another object/method.</title>
|
<title>5. Comparison: creation of a thread whose ownership is passed to another object/method.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -300,7 +304,7 @@
|
|||||||
}
|
}
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale_comparison.non-copyable.shared">
|
<section id="thread.rationale_comparison.non-copyable.shared">
|
||||||
<title>6. Comparison: creation of a thread whose ownership is shared
|
<title>6. Comparison: creation of a thread whose ownership is shared
|
||||||
between multiple objects.</title>
|
between multiple objects.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -321,18 +325,18 @@
|
|||||||
<para>This shows the usage patterns being nearly identical in complexity for
|
<para>This shows the usage patterns being nearly identical in complexity for
|
||||||
both designs. The only actual added complexity occurs because of the use of
|
both designs. The only actual added complexity occurs because of the use of
|
||||||
operator new in
|
operator new in
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link>,
|
<link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link>,
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.pass">(5)</link>, and
|
<link linkend="thread.rationale_comparison.non-copyable.pass">(5)</link>, and
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.shared">(6)</link>;
|
<link linkend="thread.rationale_comparison.non-copyable.shared">(6)</link>;
|
||||||
and the use of std::auto_ptr and boost::shared_ptr in
|
and the use of std::auto_ptr and boost::shared_ptr in
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link> and
|
<link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link> and
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.shared">(6)</link>
|
<link linkend="thread.rationale_comparison.non-copyable.shared">(6)</link>
|
||||||
respectively. However, that's not really
|
respectively. However, that's not really
|
||||||
much added complexity, and C++ programmers are used to using these idioms
|
much added complexity, and C++ programmers are used to using these idioms
|
||||||
anyway. Some may dislike the presence of operator new in user code, but
|
anyway. Some may dislike the presence of operator new in user code, but
|
||||||
this can be eliminated by proper design of higher level concepts, such as
|
this can be eliminated by proper design of higher level concepts, such as
|
||||||
the boost::thread_group class that simplifies example
|
the boost::thread_group class that simplifies example
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link>
|
<link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link>
|
||||||
down to:</para>
|
down to:</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
void foo()
|
void foo()
|
||||||
@@ -347,49 +351,49 @@
|
|||||||
design.</para>
|
design.</para>
|
||||||
<para>So what about performance? Looking at the above code examples,
|
<para>So what about performance? Looking at the above code examples,
|
||||||
we can analyze the theoretical impact to performance that both designs
|
we can analyze the theoretical impact to performance that both designs
|
||||||
have. For <link linkend="threads.rationale_comparison.non-copyable.simple">(1)</link>
|
have. For <link linkend="thread.rationale_comparison.non-copyable.simple">(1)</link>
|
||||||
we can see that platforms that don't have a ref-counted native
|
we can see that platforms that don't have a ref-counted native
|
||||||
thread type (POSIX, for instance) will be impacted by a thread_ref
|
thread type (POSIX, for instance) will be impacted by a thread_ref
|
||||||
design. Even if the native thread type is ref-counted there may be an impact
|
design. Even if the native thread type is ref-counted there may be an impact
|
||||||
if more state information has to be maintained for concepts foreign to the
|
if more state information has to be maintained for concepts foreign to the
|
||||||
native API, such as clean up stacks for Win32 implementations.
|
native API, such as clean up stacks for Win32 implementations.
|
||||||
For <link linkend="threads.rationale_comparison.non-copyable.joined">(2)</link>
|
For <link linkend="thread.rationale_comparison.non-copyable.joined">(2)</link>
|
||||||
and <link linkend="threads.rationale_comparison.non-copyable.loop">(3)</link>
|
and <link linkend="thread.rationale_comparison.non-copyable.loop">(3)</link>
|
||||||
the performance impact will be identical to
|
the performance impact will be identical to
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.simple">(1)</link>.
|
<link linkend="thread.rationale_comparison.non-copyable.simple">(1)</link>.
|
||||||
For <link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link>
|
For <link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link>
|
||||||
things get a little more interesting and we find that theoretically at least
|
things get a little more interesting and we find that theoretically at least
|
||||||
the thread_ref may perform faster since the thread design requires dynamic
|
the thread_ref may perform faster since the thread design requires dynamic
|
||||||
memory allocation/deallocation. However, in practice there may be dynamic
|
memory allocation/deallocation. However, in practice there may be dynamic
|
||||||
allocation for the thread_ref design as well, it will just be hidden from
|
allocation for the thread_ref design as well, it will just be hidden from
|
||||||
the user. As long as the implementation has to do dynamic allocations the
|
the user. As long as the implementation has to do dynamic allocations the
|
||||||
thread_ref loses again because of the reference management. For
|
thread_ref loses again because of the reference management. For
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.pass">(5)</link> we see
|
<link linkend="thread.rationale_comparison.non-copyable.pass">(5)</link> we see
|
||||||
the same impact as we do for
|
the same impact as we do for
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link>.
|
<link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link>.
|
||||||
For <link linkend="threads.rationale_comparison.non-copyable.shared">(6)</link>
|
For <link linkend="thread.rationale_comparison.non-copyable.shared">(6)</link>
|
||||||
we still have a possible impact to
|
we still have a possible impact to
|
||||||
the thread design because of dynamic allocation but thread_ref no longer
|
the thread design because of dynamic allocation but thread_ref no longer
|
||||||
suffers because of its reference management, and in fact, theoretically at
|
suffers because of its reference management, and in fact, theoretically at
|
||||||
least, the thread_ref may do a better job of managing the references. All of
|
least, the thread_ref may do a better job of managing the references. All of
|
||||||
this indicates that thread wins for
|
this indicates that thread wins for
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.simple">(1)</link>,
|
<link linkend="thread.rationale_comparison.non-copyable.simple">(1)</link>,
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.joined">(2)</link> and
|
<link linkend="thread.rationale_comparison.non-copyable.joined">(2)</link> and
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop">(3)</link>; with
|
<link linkend="thread.rationale_comparison.non-copyable.loop">(3)</link>; with
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.loop-join">(4)</link>
|
<link linkend="thread.rationale_comparison.non-copyable.loop-join">(4)</link>
|
||||||
and <link linkend="threads.rationale_comparison.non-copyable.pass">(5)</link> the
|
and <link linkend="thread.rationale_comparison.non-copyable.pass">(5)</link> the
|
||||||
winner depending on the implementation and the platform but with the thread design
|
winner depending on the implementation and the platform but with the thread design
|
||||||
probably having a better chance; and with
|
probably having a better chance; and with
|
||||||
<link linkend="threads.rationale_comparison.non-copyable.shared">(6)</link>
|
<link linkend="thread.rationale_comparison.non-copyable.shared">(6)</link>
|
||||||
it will again depend on the
|
it will again depend on the
|
||||||
implementation and platform but this time we favor thread_ref
|
implementation and platform but this time we favor thread_ref
|
||||||
slightly. Given all of this it's a narrow margin, but the thread design
|
slightly. Given all of this it's a narrow margin, but the thread design
|
||||||
prevails.</para>
|
prevails.</para>
|
||||||
<para>Given this analysis, and the fact that noncopyable objects for system
|
<para>Given this analysis, and the fact that noncopyable objects for system
|
||||||
resources are the normal designs that C++ programmers are used to dealing
|
resources are the normal designs that C++ programmers are used to dealing
|
||||||
with, the &Boost.Threads; library has gone with a noncopyable design.</para>
|
with, the &Boost.Thread; library has gone with a noncopyable design.</para>
|
||||||
</section>
|
</section>
|
||||||
<section id="threads.rationale.events">
|
<section id="thread.rationale.events">
|
||||||
<title>Rationale for not providing <emphasis>Event Variables</emphasis></title>
|
<title>Rationale for not providing <emphasis>Event Variables</emphasis></title>
|
||||||
<para><emphasis>Event variables</emphasis> are simply far too
|
<para><emphasis>Event variables</emphasis> are simply far too
|
||||||
error-prone. <classname>boost::condition</classname> variables are a much safer
|
error-prone. <classname>boost::condition</classname> variables are a much safer
|
||||||
@@ -416,13 +420,13 @@
|
|||||||
experiences caused them to be very careful in their use of event
|
experiences caused them to be very careful in their use of event
|
||||||
variables. Overt problems can be avoided, for example, by teaming the event
|
variables. Overt problems can be avoided, for example, by teaming the event
|
||||||
variable with a mutex, but that may just convert a <link
|
variable with a mutex, but that may just convert a <link
|
||||||
linkend="threads.glossary.race-condition">race condition</link> into another
|
linkend="thread.glossary.race-condition">race condition</link> into another
|
||||||
problem, such as excessive resource use. One of the most distressing aspects
|
problem, such as excessive resource use. One of the most distressing aspects
|
||||||
of the experience reports is the claim that many defects are latent. That
|
of the experience reports is the claim that many defects are latent. That
|
||||||
is, the programs appear to work correctly, but contain hidden timing
|
is, the programs appear to work correctly, but contain hidden timing
|
||||||
dependencies which will cause them to fail when environmental factors or
|
dependencies which will cause them to fail when environmental factors or
|
||||||
usage patterns change, altering relative thread timings.</para>
|
usage patterns change, altering relative thread timings.</para>
|
||||||
<para>The decision to exclude event variables from &Boost.Threads; has been
|
<para>The decision to exclude event variables from &Boost.Thread; has been
|
||||||
surprising to some Windows programmers. They have written programs which
|
surprising to some Windows programmers. They have written programs which
|
||||||
work using event variables, and wonder what the problem is. It seems similar
|
work using event variables, and wonder what the problem is. It seems similar
|
||||||
to the "goto considered harmful" controversy of 30 years ago. It isn't that
|
to the "goto considered harmful" controversy of 30 years ago. It isn't that
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/read_write_mutex.hpp"
|
<header name="boost/thread/read_write_mutex.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -16,13 +20,13 @@
|
|||||||
|
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>Specifies the
|
<para>Specifies the
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
to use when a set of threads try to obtain different types of
|
to use when a set of threads try to obtain different types of
|
||||||
locks simultaneously.</para>
|
locks simultaneously.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The only clock type supported by &Boost.Threads; is
|
<para>The only clock type supported by &Boost.Thread; is
|
||||||
<code>TIME_UTC</code>. The epoch for <code>TIME_UTC</code>
|
<code>TIME_UTC</code>. The epoch for <code>TIME_UTC</code>
|
||||||
is 1970-01-01 00:00:00.</para>
|
is 1970-01-01 00:00:00.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -32,21 +36,21 @@
|
|||||||
<class name="read_write_mutex">
|
<class name="read_write_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>read_write_mutex</classname> class is a model of the
|
<para>The <classname>read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.ReadWriteMutex">ReadWriteMutex</link> concept.</para>
|
<link linkend="thread.concepts.ReadWriteMutex">ReadWriteMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>read_write_mutex</classname> class is a model of the
|
<para>The <classname>read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.ReadWriteMutex">ReadWriteMutex</link> concept.
|
<link linkend="thread.concepts.ReadWriteMutex">ReadWriteMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>try_read_write_mutex</classname> and <classname>timed_read_write_mutex</classname>.</para>
|
<classname>try_read_write_mutex</classname> and <classname>timed_read_write_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>The <classname>read_write_mutex</classname> class supplies the following typedefs,
|
<para>The <classname>read_write_mutex</classname> class supplies the following typedefs,
|
||||||
which <link linkend="threads.concepts.read-write-lock-models">model</link>
|
which <link linkend="thread.concepts.read-write-lock-models">model</link>
|
||||||
the specified locking strategies:
|
the specified locking strategies:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -60,15 +64,15 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_write_lock</entry>
|
<entry>scoped_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_lock</entry>
|
<entry>scoped_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_write_lock</entry>
|
<entry>scoped_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -76,7 +80,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>read_write_mutex</classname> class uses an
|
<para>The <classname>read_write_mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>read_write_mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>read_write_mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -86,20 +90,20 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.read-write-mutex-models">read/write mutex models</link>
|
<link linkend="thread.concepts.read-write-mutex-models">read/write mutex models</link>
|
||||||
in &Boost.Threads;, <classname>read_write_mutex</classname> has two types of
|
in &Boost.Thread;, <classname>read_write_mutex</classname> has two types of
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
<link linkend="thread.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
between threads trying to obtain different types of locks and an
|
between threads trying to obtain different types of locks and an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
||||||
between threads trying to obtain the same type of lock.
|
between threads trying to obtain the same type of lock.
|
||||||
The <classname>read_write_mutex</classname> class allows the
|
The <classname>read_write_mutex</classname> class allows the
|
||||||
programmer to choose what
|
programmer to choose what
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
will be used; however, like all read/write mutex models,
|
will be used; however, like all read/write mutex models,
|
||||||
<classname>read_write_mutex</classname> leaves the
|
<classname>read_write_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>.
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
||||||
@@ -155,21 +159,21 @@
|
|||||||
<class name="try_read_write_mutex">
|
<class name="try_read_write_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>try_read_write_mutex</classname> class is a model of the
|
<para>The <classname>try_read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryReadWriteMutex">TryReadWriteMutex</link> concept.</para>
|
<link linkend="thread.concepts.TryReadWriteMutex">TryReadWriteMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>try_read_write_mutex</classname> class is a model of the
|
<para>The <classname>try_read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryReadWriteMutex">TryReadWriteMutex</link> concept.
|
<link linkend="thread.concepts.TryReadWriteMutex">TryReadWriteMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>read_write_mutex</classname> and <classname>timed_read_write_mutex</classname>.</para>
|
<classname>read_write_mutex</classname> and <classname>timed_read_write_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>The <classname>try_read_write_mutex</classname> class supplies the following typedefs,
|
<para>The <classname>try_read_write_mutex</classname> class supplies the following typedefs,
|
||||||
which <link linkend="threads.concepts.read-write-lock-models">model</link>
|
which <link linkend="thread.concepts.read-write-lock-models">model</link>
|
||||||
the specified locking strategies:
|
the specified locking strategies:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -183,27 +187,27 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_write_lock</entry>
|
<entry>scoped_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_read_write_lock</entry>
|
<entry>scoped_try_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryReadWriteLock">ScopedTryReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryReadWriteLock">ScopedTryReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_lock</entry>
|
<entry>scoped_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_read_lock</entry>
|
<entry>scoped_try_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_write_lock</entry>
|
<entry>scoped_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_write_lock</entry>
|
<entry>scoped_try_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -211,7 +215,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>try_read_write_mutex</classname> class uses an
|
<para>The <classname>try_read_write_mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>try_read_write_mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>try_read_write_mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -221,20 +225,20 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.read-write-mutex-models">read/write mutex models</link>
|
<link linkend="thread.concepts.read-write-mutex-models">read/write mutex models</link>
|
||||||
in &Boost.Threads;, <classname>try_read_write_mutex</classname> has two types of
|
in &Boost.Thread;, <classname>try_read_write_mutex</classname> has two types of
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
<link linkend="thread.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
between threads trying to obtain different types of locks and an
|
between threads trying to obtain different types of locks and an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
||||||
between threads trying to obtain the same type of lock.
|
between threads trying to obtain the same type of lock.
|
||||||
The <classname>try_read_write_mutex</classname> class allows the
|
The <classname>try_read_write_mutex</classname> class allows the
|
||||||
programmer to choose what
|
programmer to choose what
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
will be used; however, like all read/write mutex models,
|
will be used; however, like all read/write mutex models,
|
||||||
<classname>try_read_write_mutex</classname> leaves the
|
<classname>try_read_write_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
||||||
<link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
<link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
||||||
@@ -297,21 +301,21 @@
|
|||||||
<class name="timed_read_write_mutex">
|
<class name="timed_read_write_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>timed_read_write_mutex</classname> class is a model of the
|
<para>The <classname>timed_read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedReadWriteMutex">TimedReadWriteMutex</link> concept.</para>
|
<link linkend="thread.concepts.TimedReadWriteMutex">TimedReadWriteMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>timed_read_write_mutex</classname> class is a model of the
|
<para>The <classname>timed_read_write_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedReadWriteMutex">TimedReadWriteMutex</link> concept.
|
<link linkend="thread.concepts.TimedReadWriteMutex">TimedReadWriteMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>read_write_mutex</classname> and <classname>try_read_write_mutex</classname>.</para>
|
<classname>read_write_mutex</classname> and <classname>try_read_write_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>The <classname>timed_read_write_mutex</classname> class supplies the following typedefs,
|
<para>The <classname>timed_read_write_mutex</classname> class supplies the following typedefs,
|
||||||
which <link linkend="threads.concepts.read-write-lock-models">model</link>
|
which <link linkend="thread.concepts.read-write-lock-models">model</link>
|
||||||
the specified locking strategies:
|
the specified locking strategies:
|
||||||
|
|
||||||
<informaltable>
|
<informaltable>
|
||||||
@@ -325,39 +329,39 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_write_lock</entry>
|
<entry>scoped_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedReadWriteLock">ScopedReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_read_write_lock</entry>
|
<entry>scoped_try_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryReadWriteLock">ScopedTryReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryReadWriteLock">ScopedTryReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_timed_read_write_lock</entry>
|
<entry>scoped_timed_read_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTimedReadWriteLock">ScopedTimedReadWriteLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTimedReadWriteLock">ScopedTimedReadWriteLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_read_lock</entry>
|
<entry>scoped_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_read_lock</entry>
|
<entry>scoped_try_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_timed_read_lock</entry>
|
<entry>scoped_timed_read_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_write_lock</entry>
|
<entry>scoped_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_write_lock</entry>
|
<entry>scoped_try_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_timed_write_lock</entry>
|
<entry>scoped_timed_write_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -365,7 +369,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>timed_read_write_mutex</classname> class uses an
|
<para>The <classname>timed_read_write_mutex</classname> class uses an
|
||||||
<link linkend="threads.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
<link linkend="thread.concepts.read-write-locking-strategies.unspecified">Unspecified</link>
|
||||||
locking strategy, so attempts to recursively lock a <classname>timed_read_write_mutex</classname>
|
locking strategy, so attempts to recursively lock a <classname>timed_read_write_mutex</classname>
|
||||||
object or attempts to unlock one by threads that don't own a lock on it result in
|
object or attempts to unlock one by threads that don't own a lock on it result in
|
||||||
<emphasis role="bold">undefined behavior</emphasis>.
|
<emphasis role="bold">undefined behavior</emphasis>.
|
||||||
@@ -375,20 +379,20 @@
|
|||||||
<code>NDEBUG</code> is not defined.</para>
|
<code>NDEBUG</code> is not defined.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.read-write-mutex-models">read/write mutex models</link>
|
<link linkend="thread.concepts.read-write-mutex-models">read/write mutex models</link>
|
||||||
in &Boost.Threads;, <classname>timed_read_write_mutex</classname> has two types of
|
in &Boost.Thread;, <classname>timed_read_write_mutex</classname> has two types of
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
<link linkend="thread.concepts.read-write-scheduling-policies">scheduling policies</link>, an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
between threads trying to obtain different types of locks and an
|
between threads trying to obtain different types of locks and an
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link>
|
||||||
between threads trying to obtain the same type of lock.
|
between threads trying to obtain the same type of lock.
|
||||||
The <classname>timed_read_write_mutex</classname> class allows the
|
The <classname>timed_read_write_mutex</classname> class allows the
|
||||||
programmer to choose what
|
programmer to choose what
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
<link linkend="thread.concepts.read-write-scheduling-policies.inter-class">inter-class sheduling policy</link>
|
||||||
will be used; however, like all read/write mutex models,
|
will be used; however, like all read/write mutex models,
|
||||||
<classname>timed_read_write_mutex</classname> leaves the
|
<classname>timed_read_write_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
<link linkend="thread.concepts.read-write-scheduling-policies.intra-class">intra-class sheduling policy</link> as
|
||||||
<link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
<link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
<note>Self-deadlock is virtually guaranteed if a thread tries to
|
||||||
|
|||||||
@@ -1,29 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/recursive_mutex.hpp"
|
<header name="boost/thread/recursive_mutex.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
<class name="recursive_mutex">
|
<class name="recursive_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>recursive_mutex</classname> class is a model of the
|
<para>The <classname>recursive_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.Mutex">Mutex</link> concept.</para>
|
<link linkend="thread.concepts.Mutex">Mutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>recursive_mutex</classname> class is a model of the
|
<para>The <classname>recursive_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.Mutex">Mutex</link> concept.
|
<link linkend="thread.concepts.Mutex">Mutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>recursive_try_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para>
|
<classname>recursive_try_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics, see <classname>mutex</classname>,
|
locking mechanics, see <classname>mutex</classname>,
|
||||||
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
@@ -43,7 +47,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -51,7 +55,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>recursive_mutex</classname> class uses a
|
<para>The <classname>recursive_mutex</classname> class uses a
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking strategy, so attempts to recursively lock a
|
locking strategy, so attempts to recursively lock a
|
||||||
<classname>recursive_mutex</classname> object
|
<classname>recursive_mutex</classname> object
|
||||||
succeed and an internal "lock count" is maintained.
|
succeed and an internal "lock count" is maintained.
|
||||||
@@ -60,10 +64,10 @@
|
|||||||
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>recursive_mutex</classname> leaves the
|
in &Boost.Thread;, <classname>recursive_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -99,20 +103,20 @@
|
|||||||
<class name="recursive_try_mutex">
|
<class name="recursive_try_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>recursive_try_mutex</classname> class is a model of the
|
<para>The <classname>recursive_try_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryMutex">TryMutex</link> concept.</para>
|
<link linkend="thread.concepts.TryMutex">TryMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>recursive_try_mutex</classname> class is a model of the
|
<para>The <classname>recursive_try_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TryMutex">TryMutex</link> concept.
|
<link linkend="thread.concepts.TryMutex">TryMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>recursive_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para>
|
<classname>recursive_mutex</classname> and <classname>recursive_timed_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics, see <classname>mutex</classname>,
|
locking mechanics, see <classname>mutex</classname>,
|
||||||
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
@@ -132,11 +136,11 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_lock</entry>
|
<entry>scoped_try_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -144,7 +148,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>recursive_try_mutex</classname> class uses a
|
<para>The <classname>recursive_try_mutex</classname> class uses a
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking strategy, so attempts to recursively lock a
|
locking strategy, so attempts to recursively lock a
|
||||||
<classname>recursive_try_mutex</classname> object
|
<classname>recursive_try_mutex</classname> object
|
||||||
succeed and an internal "lock count" is maintained.
|
succeed and an internal "lock count" is maintained.
|
||||||
@@ -153,10 +157,10 @@
|
|||||||
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>recursive_try_mutex</classname> leaves the
|
in &Boost.Thread;, <classname>recursive_try_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -197,20 +201,20 @@
|
|||||||
<class name="recursive_timed_mutex">
|
<class name="recursive_timed_mutex">
|
||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>recursive_timed_mutex</classname> class is a model of the
|
<para>The <classname>recursive_timed_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedMutex">TimedMutex</link> concept.</para>
|
<link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The <classname>recursive_timed_mutex</classname> class is a model of the
|
<para>The <classname>recursive_timed_mutex</classname> class is a model of the
|
||||||
<link linkend="threads.concepts.TimedMutex">TimedMutex</link> concept.
|
<link linkend="thread.concepts.TimedMutex">TimedMutex</link> concept.
|
||||||
It should be used to synchronize access to shared resources using
|
It should be used to synchronize access to shared resources using
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking mechanics.</para>
|
locking mechanics.</para>
|
||||||
|
|
||||||
<para>For classes that model related mutex concepts, see
|
<para>For classes that model related mutex concepts, see
|
||||||
<classname>recursive_mutex</classname> and <classname>recursive_try_mutex</classname>.</para>
|
<classname>recursive_mutex</classname> and <classname>recursive_try_mutex</classname>.</para>
|
||||||
|
|
||||||
<para>For <link linkend="threads.concepts.unspecified-locking-strategy">Unspecified</link>
|
<para>For <link linkend="thread.concepts.unspecified-locking-strategy">Unspecified</link>
|
||||||
locking mechanics, see <classname>mutex</classname>,
|
locking mechanics, see <classname>mutex</classname>,
|
||||||
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
<classname>try_mutex</classname>, and <classname>timed_mutex</classname>.
|
||||||
</para>
|
</para>
|
||||||
@@ -230,15 +234,15 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_lock</entry>
|
<entry>scoped_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedLock">ScopedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedLock">ScopedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_try_lock</entry>
|
<entry>scoped_try_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTryLock">ScopedTryLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>scoped_timed_lock</entry>
|
<entry>scoped_timed_lock</entry>
|
||||||
<entry><link linkend="threads.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
<entry><link linkend="thread.concepts.ScopedTimedLock">ScopedTimedLock</link></entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -246,7 +250,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>The <classname>recursive_timed_mutex</classname> class uses a
|
<para>The <classname>recursive_timed_mutex</classname> class uses a
|
||||||
<link linkend="threads.concepts.recursive-locking-strategy">Recursive</link>
|
<link linkend="thread.concepts.recursive-locking-strategy">Recursive</link>
|
||||||
locking strategy, so attempts to recursively lock a
|
locking strategy, so attempts to recursively lock a
|
||||||
<classname>recursive_timed_mutex</classname> object
|
<classname>recursive_timed_mutex</classname> object
|
||||||
succeed and an internal "lock count" is maintained.
|
succeed and an internal "lock count" is maintained.
|
||||||
@@ -255,10 +259,10 @@
|
|||||||
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
<emphasis role="bold">undefined behavior</emphasis>.</para>
|
||||||
|
|
||||||
<para>Like all
|
<para>Like all
|
||||||
<link linkend="threads.concepts.mutex-models">mutex models</link>
|
<link linkend="thread.concepts.mutex-models">mutex models</link>
|
||||||
in &Boost.Threads;, <classname>recursive_timed_mutex</classname> leaves the
|
in &Boost.Thread;, <classname>recursive_timed_mutex</classname> leaves the
|
||||||
<link linkend="threads.concepts.sheduling-policies">scheduling policy</link>
|
<link linkend="thread.concepts.sheduling-policies">scheduling policy</link>
|
||||||
as <link linkend="threads.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
as <link linkend="thread.concepts.unspecified-scheduling-policy">Unspecified</link>.
|
||||||
Programmers should make no assumptions about the order in which
|
Programmers should make no assumptions about the order in which
|
||||||
waiting threads acquire a lock.</para>
|
waiting threads acquire a lock.</para>
|
||||||
</description>
|
</description>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<library-reference id="threads.reference"
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<library-reference id="thread.reference"
|
||||||
last-revision="$Date$"
|
last-revision="$Date$"
|
||||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
<xi:include href="barrier-ref.xml"/>
|
<xi:include href="barrier-ref.xml"/>
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<section id="threads.release_notes" last-revision="$Date$">
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<section id="thread.release_notes" last-revision="$Date$">
|
||||||
<title>Release Notes</title>
|
<title>Release Notes</title>
|
||||||
<section id="threads.release_notes.boost_1_32_0">
|
<section id="thread.release_notes.boost_1_32_0">
|
||||||
<title>Boost 1.32.0</title>
|
<title>Boost 1.32.0</title>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.documentation">
|
<section id="thread.release_notes.boost_1_32_0.change_log.documentation">
|
||||||
<title>Documentation converted to BoostBook</title>
|
<title>Documentation converted to BoostBook</title>
|
||||||
|
|
||||||
<para>The documentation was converted to BoostBook format,
|
<para>The documentation was converted to BoostBook format,
|
||||||
@@ -20,24 +24,24 @@
|
|||||||
please report them!</para>
|
please report them!</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.static_link">
|
<section id="thread.release_notes.boost_1_32_0.change_log.static_link">
|
||||||
<title>Statically-link build option added</title>
|
<title>Statically-link build option added</title>
|
||||||
|
|
||||||
<para>The option to link &Boost.Threads; as a static
|
<para>The option to link &Boost.Thread; as a static
|
||||||
library has been added (with some limitations on Win32 platforms).
|
library has been added (with some limitations on Win32 platforms).
|
||||||
This feature was originally removed from an earlier version
|
This feature was originally removed from an earlier version
|
||||||
of Boost because <classname>boost::thread_specific_ptr</classname>
|
of Boost because <classname>boost::thread_specific_ptr</classname>
|
||||||
required that &Boost.Threads; be dynamically linked in order
|
required that &Boost.Thread; be dynamically linked in order
|
||||||
for its cleanup functionality to work on Win32 platforms.
|
for its cleanup functionality to work on Win32 platforms.
|
||||||
Because this limitation never applied to non-Win32 platforms,
|
Because this limitation never applied to non-Win32 platforms,
|
||||||
because significant progress has been made in removing
|
because significant progress has been made in removing
|
||||||
the limitation on Win32 platforms (many thanks to
|
the limitation on Win32 platforms (many thanks to
|
||||||
Aaron LaFramboise and Roland Scwarz!), and because the lack
|
Aaron LaFramboise and Roland Scwarz!), and because the lack
|
||||||
of static linking is one of the most common complaints of
|
of static linking is one of the most common complaints of
|
||||||
&Boost.Threads; users, this decision was reversed.</para>
|
&Boost.Thread; users, this decision was reversed.</para>
|
||||||
|
|
||||||
<para>On non-Win32 platforms:
|
<para>On non-Win32 platforms:
|
||||||
To choose the dynamically linked version of &Boost.Threads;
|
To choose the dynamically linked version of &Boost.Thread;
|
||||||
using Boost's auto-linking feature, #define BOOST_THREAD_USE_DLL;
|
using Boost's auto-linking feature, #define BOOST_THREAD_USE_DLL;
|
||||||
to choose the statically linked version,
|
to choose the statically linked version,
|
||||||
#define BOOST_THREAD_USE_LIB.
|
#define BOOST_THREAD_USE_LIB.
|
||||||
@@ -63,9 +67,9 @@
|
|||||||
because it has not yet been possible to implement automatic
|
because it has not yet been possible to implement automatic
|
||||||
tss cleanup in the statically linked version for compilers
|
tss cleanup in the statically linked version for compilers
|
||||||
other than VC++, although it is hoped that this will be
|
other than VC++, although it is hoped that this will be
|
||||||
possible in a future version of &Boost.Threads;.
|
possible in a future version of &Boost.Thread;.
|
||||||
|
|
||||||
Note for advanced users: &Boost.Threads; provides several "hook"
|
Note for advanced users: &Boost.Thread; provides several "hook"
|
||||||
functions to allow users to experiment with the statically
|
functions to allow users to experiment with the statically
|
||||||
linked version on Win32 with compilers other than VC++.
|
linked version on Win32 with compilers other than VC++.
|
||||||
These functions are on_process_enter(), on_process_exit(),
|
These functions are on_process_enter(), on_process_exit(),
|
||||||
@@ -74,13 +78,13 @@
|
|||||||
information.</para>
|
information.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.barrier">
|
<section id="thread.release_notes.boost_1_32_0.change_log.barrier">
|
||||||
<title>Barrier functionality added</title>
|
<title>Barrier functionality added</title>
|
||||||
|
|
||||||
<para>A new class, <classname>boost::barrier</classname>, was added.</para>
|
<para>A new class, <classname>boost::barrier</classname>, was added.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.read_write_mutex">
|
<section id="thread.release_notes.boost_1_32_0.change_log.read_write_mutex">
|
||||||
<title>Read/write mutex functionality added</title>
|
<title>Read/write mutex functionality added</title>
|
||||||
|
|
||||||
<para>New classes,
|
<para>New classes,
|
||||||
@@ -91,13 +95,13 @@
|
|||||||
|
|
||||||
<note>Since the read/write mutex and related classes are new,
|
<note>Since the read/write mutex and related classes are new,
|
||||||
both interface and implementation are liable to change
|
both interface and implementation are liable to change
|
||||||
in future releases of &Boost.Threads;.
|
in future releases of &Boost.Thread;.
|
||||||
The lock concepts and lock promotion in particular are
|
The lock concepts and lock promotion in particular are
|
||||||
still under discussion and very likely to change.</note>
|
still under discussion and very likely to change.</note>
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.thread_specific_ptr">
|
<section id="thread.release_notes.boost_1_32_0.change_log.thread_specific_ptr">
|
||||||
<title>Thread-specific pointer functionality changed</title>
|
<title>Thread-specific pointer functionality changed</title>
|
||||||
|
|
||||||
<para>The <classname>boost::thread_specific_ptr</classname>
|
<para>The <classname>boost::thread_specific_ptr</classname>
|
||||||
@@ -124,7 +128,7 @@
|
|||||||
is called.</para>
|
is called.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.mutex">
|
<section id="thread.release_notes.boost_1_32_0.change_log.mutex">
|
||||||
<title>Mutex implementation changed for Win32</title>
|
<title>Mutex implementation changed for Win32</title>
|
||||||
|
|
||||||
<para>On Win32, <classname>boost::mutex</classname>,
|
<para>On Win32, <classname>boost::mutex</classname>,
|
||||||
@@ -135,10 +139,10 @@
|
|||||||
<classname>boost::recursive_timed_mutex</classname> use a Win32 mutex.</para>
|
<classname>boost::recursive_timed_mutex</classname> use a Win32 mutex.</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="threads.release_notes.boost_1_32_0.change_log.wince">
|
<section id="thread.release_notes.boost_1_32_0.change_log.wince">
|
||||||
<title>Windows CE support improved</title>
|
<title>Windows CE support improved</title>
|
||||||
|
|
||||||
<para>Minor changes were made to make Boost.Threads work on Windows CE.</para>
|
<para>Minor changes were made to make Boost.Thread work on Windows CE.</para>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/thread.hpp"
|
<header name="boost/thread/thread.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -11,15 +15,15 @@
|
|||||||
<purpose>
|
<purpose>
|
||||||
<para>The <classname>thread</classname> class represents threads of
|
<para>The <classname>thread</classname> class represents threads of
|
||||||
execution, and provides the functionality to create and manage
|
execution, and provides the functionality to create and manage
|
||||||
threads within the &Boost.Threads; library. See
|
threads within the &Boost.Thread; library. See
|
||||||
<xref linkend="threads.glossary"/> for a precise description of
|
<xref linkend="thread.glossary"/> for a precise description of
|
||||||
<link linkend="threads.glossary.thread">thread of execution</link>,
|
<link linkend="thread.glossary.thread">thread of execution</link>,
|
||||||
and for definitions of threading-related terms and of thread states such as
|
and for definitions of threading-related terms and of thread states such as
|
||||||
<link linkend="threads.glossary.thread-state">blocked</link>.</para>
|
<link linkend="thread.glossary.thread-state">blocked</link>.</para>
|
||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>A <link linkend="threads.glossary.thread">thread of execution</link>
|
<para>A <link linkend="thread.glossary.thread">thread of execution</link>
|
||||||
has an initial function. For the program's initial thread, the initial
|
has an initial function. For the program's initial thread, the initial
|
||||||
function is <code>main()</code>. For other threads, the initial
|
function is <code>main()</code>. For other threads, the initial
|
||||||
function is <code>operator()</code> of the function object passed to
|
function is <code>operator()</code> of the function object passed to
|
||||||
@@ -36,7 +40,7 @@
|
|||||||
"joinable" or "non-joinable".</para>
|
"joinable" or "non-joinable".</para>
|
||||||
|
|
||||||
<para>Except as described below, the policy used by an implementation
|
<para>Except as described below, the policy used by an implementation
|
||||||
of &Boost.Threads; to schedule transitions between thread states is
|
of &Boost.Thread; to schedule transitions between thread states is
|
||||||
unspecified.</para>
|
unspecified.</para>
|
||||||
|
|
||||||
<para><note>Just as the lifetime of a file may be different from the
|
<para><note>Just as the lifetime of a file may be different from the
|
||||||
@@ -149,7 +153,7 @@
|
|||||||
<notes>If <code>*this == thread()</code> the result is
|
<notes>If <code>*this == thread()</code> the result is
|
||||||
implementation-defined. If the implementation doesn't
|
implementation-defined. If the implementation doesn't
|
||||||
detect this the result will be
|
detect this the result will be
|
||||||
<link linkend="threads.glossary.deadlock">deadlock</link>.
|
<link linkend="thread.glossary.deadlock">deadlock</link>.
|
||||||
</notes>
|
</notes>
|
||||||
</method>
|
</method>
|
||||||
</method-group>
|
</method-group>
|
||||||
@@ -170,7 +174,7 @@
|
|||||||
<type>void</type>
|
<type>void</type>
|
||||||
|
|
||||||
<effects>The current thread of execution is placed in the
|
<effects>The current thread of execution is placed in the
|
||||||
<link linkend="threads.glossary.thread-state">ready</link>
|
<link linkend="thread.glossary.thread-state">ready</link>
|
||||||
state.</effects>
|
state.</effects>
|
||||||
|
|
||||||
<notes>
|
<notes>
|
||||||
@@ -260,7 +264,20 @@
|
|||||||
<effects>Calls <code>join()</code> on each of the managed
|
<effects>Calls <code>join()</code> on each of the managed
|
||||||
<classname>thread</classname> objects.</effects>
|
<classname>thread</classname> objects.</effects>
|
||||||
</method>
|
</method>
|
||||||
</method-group>
|
</method-group>
|
||||||
|
|
||||||
|
<method-group name="capacity">
|
||||||
|
|
||||||
|
<method name="size" cv="const">
|
||||||
|
<type>int</type>
|
||||||
|
|
||||||
|
<returns>the number of <classname>thread</classname>
|
||||||
|
objects in the group
|
||||||
|
</returns>
|
||||||
|
|
||||||
|
</method>
|
||||||
|
|
||||||
|
</method-group>
|
||||||
</class>
|
</class>
|
||||||
</namespace>
|
</namespace>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
<library name="Threads" dirname="thread" id="threads"
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
<library name="Thread" dirname="thread" id="thread"
|
||||||
last-revision="$Date$"
|
last-revision="$Date$"
|
||||||
xmlns:xi="http://www.w3.org/2001/XInclude">
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
<libraryinfo>
|
<libraryinfo>
|
||||||
@@ -20,19 +24,14 @@ xmlns:xi="http://www.w3.org/2001/XInclude">
|
|||||||
<holder>William E. Kempf</holder>
|
<holder>William E. Kempf</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
<legalnotice>
|
<legalnotice>
|
||||||
<para>Permission to use, copy, modify, distribute and sell this
|
<para>Subject to the Boost Software License, Version 1.0.
|
||||||
software and its documentation for any purpose is hereby granted
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)</para>
|
||||||
without fee, provided that the above copyright notice appear in all
|
|
||||||
copies and that both that copyright notice and this permission notice
|
|
||||||
appear in supporting documentation. William E. Kempf makes no
|
|
||||||
representations about the suitability of this software for any purpose.
|
|
||||||
It is provided "as is" without express or implied warranty.</para>
|
|
||||||
</legalnotice>
|
</legalnotice>
|
||||||
<librarypurpose>Portable C++ multi-threading</librarypurpose>
|
<librarypurpose>Portable C++ multi-threading</librarypurpose>
|
||||||
<librarycategory name="category:concurrent" />
|
<librarycategory name="category:concurrent" />
|
||||||
<title>Boost.Threads</title>
|
<title>Boost.Thread</title>
|
||||||
</libraryinfo>
|
</libraryinfo>
|
||||||
<title>Boost.Threads</title>
|
<title>Boost.Thread</title>
|
||||||
<xi:include href="overview.xml"/>
|
<xi:include href="overview.xml"/>
|
||||||
<xi:include href="design.xml"/>
|
<xi:include href="design.xml"/>
|
||||||
<xi:include href="concepts.xml"/>
|
<xi:include href="concepts.xml"/>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/tss.hpp"
|
<header name="boost/thread/tss.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -17,7 +21,7 @@
|
|||||||
<para>Thread specific storage is data associated with
|
<para>Thread specific storage is data associated with
|
||||||
individual threads and is often used to make operations
|
individual threads and is often used to make operations
|
||||||
that rely on global data
|
that rely on global data
|
||||||
<link linkend="threads.glossary.thread-safe">thread-safe</link>.
|
<link linkend="thread.glossary.thread-safe">thread-safe</link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>Template <classname>thread_specific_ptr</classname>
|
<para>Template <classname>thread_specific_ptr</classname>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
|
||||||
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd" [
|
||||||
<!ENTITY % threads.entities SYSTEM "entities.xml">
|
<!ENTITY % thread.entities SYSTEM "entities.xml">
|
||||||
%threads.entities;
|
%thread.entities;
|
||||||
]>
|
]>
|
||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf, Michael Glassford
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
<header name="boost/thread/xtime.hpp"
|
<header name="boost/thread/xtime.hpp"
|
||||||
last-revision="$Date$">
|
last-revision="$Date$">
|
||||||
<namespace name="boost">
|
<namespace name="boost">
|
||||||
@@ -16,7 +20,7 @@
|
|||||||
</purpose>
|
</purpose>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<para>The only clock type supported by &Boost.Threads; is
|
<para>The only clock type supported by &Boost.Thread; is
|
||||||
<code>TIME_UTC</code>. The epoch for <code>TIME_UTC</code>
|
<code>TIME_UTC</code>. The epoch for <code>TIME_UTC</code>
|
||||||
is 1970-01-01 00:00:00.</para>
|
is 1970-01-01 00:00:00.</para>
|
||||||
</description>
|
</description>
|
||||||
@@ -33,9 +37,9 @@
|
|||||||
<description>
|
<description>
|
||||||
<simpara>The <classname>xtime</classname> type is used to represent a point on
|
<simpara>The <classname>xtime</classname> type is used to represent a point on
|
||||||
some time scale or a duration in time. This type may be proposed for the C standard by
|
some time scale or a duration in time. This type may be proposed for the C standard by
|
||||||
Markus Kuhn. &Boost.Threads; provides only a very minimal implementation of this
|
Markus Kuhn. &Boost.Thread; provides only a very minimal implementation of this
|
||||||
proposal; it is expected that a full implementation (or some other time
|
proposal; it is expected that a full implementation (or some other time
|
||||||
library) will be provided in Boost as a separate library, at which time &Boost.Threads;
|
library) will be provided in Boost as a separate library, at which time &Boost.Thread;
|
||||||
will deprecate its own implementation.</simpara>
|
will deprecate its own implementation.</simpara>
|
||||||
|
|
||||||
<simpara><emphasis role="bold">Note</emphasis> that the resolution is
|
<simpara><emphasis role="bold">Note</emphasis> that the resolution is
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
# Copyright (C) 2001-2003
|
|
||||||
# William E. Kempf
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, distribute and sell this software
|
|
||||||
# and its documentation for any purpose is hereby granted without fee,
|
|
||||||
# provided that the above copyright notice appear in all copies and
|
|
||||||
# that both that copyright notice and this permission notice appear
|
|
||||||
# in supporting documentation. William E. Kempf makes no representations
|
|
||||||
# about the suitability of this software for any purpose.
|
|
||||||
# It is provided "as is" without express or implied warranty.
|
|
||||||
#
|
|
||||||
# Boost.Threads example Jamfile
|
|
||||||
#
|
|
||||||
# Additional configuration variables used:
|
|
||||||
# 1. PTW32 may be used on Win32 platforms to specify that the pthreads-win32
|
|
||||||
# library should be used instead of "native" threads. This feature is
|
|
||||||
# mostly used for testing and it's generally recommended you use the
|
|
||||||
# native threading libraries instead. PTW32 should be set to be a list
|
|
||||||
# of two strings, the first specifying the installation path of the
|
|
||||||
# pthreads-win32 library and the second specifying which library
|
|
||||||
# variant to link against (see the pthreads-win32 documentation).
|
|
||||||
# Example: jam -sPTW32="c:\pthreads-win32 pthreadVCE.lib"
|
|
||||||
|
|
||||||
# Declare the location of this subproject relative to the root.
|
|
||||||
subproject libs/thread/example ;
|
|
||||||
|
|
||||||
# Include threads.jam for Boost.Threads global build information.
|
|
||||||
# This greatly simplifies the Jam code needed to configure the build
|
|
||||||
# for the various Win32 build types.
|
|
||||||
import ../build/threads ;
|
|
||||||
|
|
||||||
{
|
|
||||||
template example
|
|
||||||
## sources ##
|
|
||||||
: <template>thread_base
|
|
||||||
<dll>../build/boost_thread
|
|
||||||
## requirements ##
|
|
||||||
:
|
|
||||||
## default build ##
|
|
||||||
:
|
|
||||||
;
|
|
||||||
|
|
||||||
exe monitor : <template>example monitor.cpp ;
|
|
||||||
exe starvephil : <template>example starvephil.cpp ;
|
|
||||||
exe tennis : <template>example tennis.cpp ;
|
|
||||||
exe condition : <template>example condition.cpp ;
|
|
||||||
exe mutex : <template>example mutex.cpp ;
|
|
||||||
exe once : <template>example once.cpp ;
|
|
||||||
exe recursive_mutex : <template>example recursive_mutex.cpp ;
|
|
||||||
exe thread : <template>example thread.cpp ;
|
|
||||||
exe thread_group : <template>example thread_group.cpp ;
|
|
||||||
exe tss : <template>example tss.cpp ;
|
|
||||||
exe xtime : <template>example xtime.cpp ;
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
# Copyright (C) 2001-2003
|
||||||
|
# William E. Kempf
|
||||||
|
#
|
||||||
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
project boost/thread/example
|
project boost/thread/example
|
||||||
: requirements <library>../build//boost_thread <threading>multi
|
: requirements <library>../build//boost_thread <threading>multi
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/once.hpp>
|
#include <boost/thread/once.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/recursive_mutex.hpp>
|
#include <boost/thread/recursive_mutex.hpp>
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/condition.hpp>
|
#include <boost/thread/condition.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/condition.hpp>
|
#include <boost/thread/condition.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/xtime.hpp>
|
#include <boost/thread/xtime.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/xtime.hpp>
|
#include <boost/thread/xtime.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#if !defined(BOOST_THREAD_WEK01082003_HPP)
|
#if !defined(BOOST_THREAD_WEK01082003_HPP)
|
||||||
#define BOOST_THREAD_WEK01082003_HPP
|
#define BOOST_THREAD_WEK01082003_HPP
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2002-2003
|
// Copyright (C) 2002-2003
|
||||||
// David Moore, William E. Kempf
|
// David Moore, William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_BARRIER_JDM030602_HPP
|
#ifndef BOOST_BARRIER_JDM030602_HPP
|
||||||
#define BOOST_BARRIER_JDM030602_HPP
|
#define BOOST_BARRIER_JDM030602_HPP
|
||||||
@@ -29,7 +24,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
mutex m_mutex;
|
mutex m_mutex;
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
condition m_cond;
|
condition m_cond;
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
unsigned int m_threshold;
|
unsigned int m_threshold;
|
||||||
unsigned int m_count;
|
unsigned int m_count;
|
||||||
unsigned int m_generation;
|
unsigned int m_generation;
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_CONDITION_WEK070601_HPP
|
#ifndef BOOST_CONDITION_WEK070601_HPP
|
||||||
#define BOOST_CONDITION_WEK070601_HPP
|
#define BOOST_CONDITION_WEK070601_HPP
|
||||||
@@ -27,7 +22,12 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
struct xtime;
|
struct xtime;
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
class BOOST_THREAD_DECL condition_impl : private noncopyable
|
class BOOST_THREAD_DECL condition_impl : private noncopyable
|
||||||
@@ -185,7 +185,9 @@ private:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
// Change Log:
|
// Change Log:
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
|
#ifndef BOOST_THREAD_CONFIG_WEK01032003_HPP
|
||||||
#define BOOST_THREAD_CONFIG_WEK01032003_HPP
|
#define BOOST_THREAD_CONFIG_WEK01032003_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||||
|
# pragma warn -8008 // Condition always true/false
|
||||||
|
# pragma warn -8080 // Identifier declared but never used
|
||||||
|
# pragma warn -8057 // Parameter never used
|
||||||
|
# pragma warn -8066 // Unreachable code
|
||||||
|
#endif
|
||||||
|
|
||||||
// insist on threading support being available:
|
// insist on threading support being available:
|
||||||
#include <boost/config/requires_threads.hpp>
|
#include <boost/config/requires_threads.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_XLOCK_WEK070601_HPP
|
#ifndef BOOST_XLOCK_WEK070601_HPP
|
||||||
#define BOOST_XLOCK_WEK070601_HPP
|
#define BOOST_XLOCK_WEK070601_HPP
|
||||||
|
|||||||
@@ -5,13 +5,8 @@
|
|||||||
// Copyright (C) 2001
|
// Copyright (C) 2001
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. David Moore makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_READ_WRITE_LOCK_JDM031002_HPP
|
#ifndef BOOST_READ_WRITE_LOCK_JDM031002_HPP
|
||||||
#define BOOST_READ_WRITE_LOCK_JDM031002_HPP
|
#define BOOST_READ_WRITE_LOCK_JDM031002_HPP
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
//Currently only implemented for Win32, but should
|
//Currently only implemented for Win32, but should
|
||||||
//later be implemented for all platforms.
|
//later be implemented for all platforms.
|
||||||
//Used by Win32 implementation of Boost.Threads
|
//Used by Win32 implementation of Boost.Threads
|
||||||
//tss to peform cleanup.
|
//tss to perform cleanup.
|
||||||
//Like the C runtime library atexit() function,
|
//Like the C runtime library atexit() function,
|
||||||
//which it mimics, at_thread_exit() returns
|
//which it mimics, at_thread_exit() returns
|
||||||
//zero if successful and a nonzero
|
//zero if successful and a nonzero
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
#ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
||||||
#define BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
#define BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
||||||
@@ -36,8 +31,6 @@ public:
|
|||||||
|
|
||||||
int native_error() const;
|
int native_error() const;
|
||||||
|
|
||||||
const char* message() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_sys_err;
|
int m_sys_err;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_MUTEX_WEK070601_HPP
|
#ifndef BOOST_MUTEX_WEK070601_HPP
|
||||||
#define BOOST_MUTEX_WEK070601_HPP
|
#define BOOST_MUTEX_WEK070601_HPP
|
||||||
@@ -28,7 +23,12 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
struct xtime;
|
struct xtime;
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
class BOOST_THREAD_DECL mutex
|
class BOOST_THREAD_DECL mutex
|
||||||
: private noncopyable
|
: private noncopyable
|
||||||
{
|
{
|
||||||
@@ -155,7 +155,9 @@ private:
|
|||||||
threads::mac::detail::scoped_critical_region m_mutex_mutex;
|
threads::mac::detail::scoped_critical_region m_mutex_mutex;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
// Change Log:
|
// Change Log:
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_ONCE_WEK080101_HPP
|
#ifndef BOOST_ONCE_WEK080101_HPP
|
||||||
#define BOOST_ONCE_WEK080101_HPP
|
#define BOOST_ONCE_WEK080101_HPP
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2002-2003
|
// Copyright (C) 2002-2003
|
||||||
// David Moore, William E. Kempf, Michael Glassford
|
// David Moore, William E. Kempf, Michael Glassford
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. David Moore makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
// A Boost::threads implementation of a synchronization
|
// A Boost::threads implementation of a synchronization
|
||||||
// primitive which can allow multiple readers or a single
|
// primitive which can allow multiple readers or a single
|
||||||
@@ -27,7 +22,12 @@
|
|||||||
#include <boost/thread/condition.hpp>
|
#include <boost/thread/condition.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
namespace read_write_scheduling_policy {
|
namespace read_write_scheduling_policy {
|
||||||
enum read_write_scheduling_policy_enum
|
enum read_write_scheduling_policy_enum
|
||||||
{
|
{
|
||||||
@@ -265,7 +265,9 @@ private:
|
|||||||
|
|
||||||
detail::thread::read_write_mutex_impl<timed_mutex> m_impl;
|
detail::thread::read_write_mutex_impl<timed_mutex> m_impl;
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
#ifndef BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
||||||
#define BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
#define BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
||||||
@@ -28,7 +23,12 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
struct xtime;
|
struct xtime;
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
class BOOST_THREAD_DECL recursive_mutex
|
class BOOST_THREAD_DECL recursive_mutex
|
||||||
: private noncopyable
|
: private noncopyable
|
||||||
{
|
{
|
||||||
@@ -169,7 +169,9 @@ private:
|
|||||||
std::size_t m_count;
|
std::size_t m_count;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
#endif // BOOST_RECURSIVE_MUTEX_WEK070601_HPP
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_THREAD_WEK070601_HPP
|
#ifndef BOOST_THREAD_WEK070601_HPP
|
||||||
#define BOOST_THREAD_WEK070601_HPP
|
#define BOOST_THREAD_WEK070601_HPP
|
||||||
@@ -30,7 +25,12 @@
|
|||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
struct xtime;
|
struct xtime;
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
class BOOST_THREAD_DECL thread : private noncopyable
|
class BOOST_THREAD_DECL thread : private noncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -70,13 +70,15 @@ public:
|
|||||||
void add_thread(thread* thrd);
|
void add_thread(thread* thrd);
|
||||||
void remove_thread(thread* thrd);
|
void remove_thread(thread* thrd);
|
||||||
void join_all();
|
void join_all();
|
||||||
int size();
|
int size() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::list<thread*> m_threads;
|
std::list<thread*> m_threads;
|
||||||
mutex m_mutex;
|
mutex m_mutex;
|
||||||
};
|
};
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
// Change Log:
|
// Change Log:
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003 William E. Kempf
|
||||||
// William E. Kempf
|
// Copyright (C) 2006 Roland Schwarz
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_TSS_WEK070601_HPP
|
#ifndef BOOST_TSS_WEK070601_HPP
|
||||||
#define BOOST_TSS_WEK070601_HPP
|
#define BOOST_TSS_WEK070601_HPP
|
||||||
@@ -26,6 +21,13 @@
|
|||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
|
// disable warnings about non dll import
|
||||||
|
// see: http://www.boost.org/more/separate_compilation.html#dlls
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable: 4251 4231 4660 4275)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
class BOOST_THREAD_DECL tss : private noncopyable
|
class BOOST_THREAD_DECL tss : private noncopyable
|
||||||
@@ -43,7 +45,7 @@ public:
|
|||||||
throw boost::thread_resource_error();
|
throw boost::thread_resource_error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
~tss();
|
||||||
void* get() const;
|
void* get() const;
|
||||||
void set(void* value);
|
void set(void* value);
|
||||||
void cleanup(void* p);
|
void cleanup(void* p);
|
||||||
@@ -103,6 +105,10 @@ private:
|
|||||||
detail::tss m_tss;
|
detail::tss m_tss;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif //BOOST_TSS_WEK070601_HPP
|
#endif //BOOST_TSS_WEK070601_HPP
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#ifndef BOOST_XTIME_WEK070601_HPP
|
#ifndef BOOST_XTIME_WEK070601_HPP
|
||||||
#define BOOST_XTIME_WEK070601_HPP
|
#define BOOST_XTIME_WEK070601_HPP
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<!-- Copyright (c) 2002-2003 William E. Kempf.
|
||||||
|
Subject to the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
|
||||||
|
-->
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="refresh" content="0; URL=doc/index.html">
|
<meta http-equiv="refresh" content="0; URL=doc/index.html">
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2002-2003
|
// Copyright (C) 2002-2003
|
||||||
// David Moore, William E. Kempf
|
// David Moore, William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
#include <boost/thread/barrier.hpp>
|
#include <boost/thread/barrier.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
@@ -15,57 +10,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
# ifdef BOOST_NO_STDC_NAMESPACE
|
|
||||||
namespace std { using ::strerror; }
|
|
||||||
# endif
|
|
||||||
|
|
||||||
// BOOST_POSIX or BOOST_WINDOWS specify which API to use.
|
|
||||||
# if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
|
|
||||||
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
|
|
||||||
# define BOOST_WINDOWS
|
|
||||||
# else
|
|
||||||
# define BOOST_POSIX
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined( BOOST_WINDOWS )
|
|
||||||
# include "windows.h"
|
|
||||||
# else
|
|
||||||
# include <errno.h> // for POSIX error codes
|
|
||||||
# endif
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
|
|
||||||
std::string system_message(int sys_err_code)
|
|
||||||
{
|
|
||||||
std::string str;
|
|
||||||
# ifdef BOOST_WINDOWS
|
|
||||||
LPVOID lpMsgBuf;
|
|
||||||
::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
||||||
NULL,
|
|
||||||
sys_err_code,
|
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
|
||||||
(LPSTR)&lpMsgBuf,
|
|
||||||
0,
|
|
||||||
NULL);
|
|
||||||
str += static_cast<LPCSTR>(lpMsgBuf);
|
|
||||||
::LocalFree(lpMsgBuf); // free the buffer
|
|
||||||
while (str.size() && (str[str.size()-1] == '\n' ||
|
|
||||||
str[str.size()-1] == '\r'))
|
|
||||||
{
|
|
||||||
str.erase(str.size()-1);
|
|
||||||
}
|
|
||||||
# else
|
|
||||||
str += std::strerror(errno);
|
|
||||||
# endif
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // unnamed namespace
|
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
thread_exception::thread_exception()
|
thread_exception::thread_exception()
|
||||||
@@ -87,13 +31,6 @@ int thread_exception::native_error() const
|
|||||||
return m_sys_err;
|
return m_sys_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* thread_exception::message() const
|
|
||||||
{
|
|
||||||
if (m_sys_err != 0)
|
|
||||||
return system_message(m_sys_err).c_str();
|
|
||||||
return what();
|
|
||||||
}
|
|
||||||
|
|
||||||
lock_error::lock_error()
|
lock_error::lock_error()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
// boostinspect:nounnamed
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -28,7 +24,7 @@ void init_TryEnterCriticalSection()
|
|||||||
version_info.dwMajorVersion >= 4)
|
version_info.dwMajorVersion >= 4)
|
||||||
{
|
{
|
||||||
if (HMODULE kernel_module = GetModuleHandle(TEXT("KERNEL32.DLL")))
|
if (HMODULE kernel_module = GetModuleHandle(TEXT("KERNEL32.DLL")))
|
||||||
g_TryEnterCriticalSection = reinterpret_cast<TryEnterCriticalSection_type>(GetProcAddress(kernel_module, "TryEnterCriticalSection"));
|
g_TryEnterCriticalSection = reinterpret_cast<TryEnterCriticalSection_type>(GetProcAddress(kernel_module, TEXT("TryEnterCriticalSection")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,8 +62,10 @@ inline void* new_critical_section()
|
|||||||
inline void* new_mutex(const char* name)
|
inline void* new_mutex(const char* name)
|
||||||
{
|
{
|
||||||
#if defined(BOOST_NO_ANSI_APIS)
|
#if defined(BOOST_NO_ANSI_APIS)
|
||||||
USES_CONVERSION;
|
int num_wide_chars = (strlen(name) + 1);
|
||||||
HANDLE mutex = CreateMutexW(0, 0, A2CW(name));
|
LPWSTR wide_name = (LPWSTR)_alloca( num_wide_chars * 2 );
|
||||||
|
::MultiByteToWideChar(CP_ACP, 0, name, -1, wide_name, num_wide_chars);
|
||||||
|
HANDLE mutex = CreateMutexW(0, 0, wide_name);
|
||||||
#else
|
#else
|
||||||
HANDLE mutex = CreateMutexA(0, 0, name);
|
HANDLE mutex = CreateMutexA(0, 0, name);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
22
src/once.cpp
22
src/once.cpp
@@ -1,19 +1,15 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#include <boost/thread/once.hpp>
|
#include <boost/thread/once.hpp>
|
||||||
|
#include <boost/thread/exceptions.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@@ -23,6 +19,7 @@
|
|||||||
using std::size_t;
|
using std::size_t;
|
||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
# include "mutex.inl"
|
||||||
# if defined(BOOST_NO_STRINGSTREAM)
|
# if defined(BOOST_NO_STRINGSTREAM)
|
||||||
# include <strstream>
|
# include <strstream>
|
||||||
|
|
||||||
@@ -118,7 +115,11 @@ inline LONG ice_wrapper(LPVOID (__stdcall *ice)(LPVOID*, LPVOID, LPVOID),
|
|||||||
// according to the above function type wrappers.
|
// according to the above function type wrappers.
|
||||||
inline LONG compare_exchange(volatile LPLONG dest, LONG exch, LONG cmp)
|
inline LONG compare_exchange(volatile LPLONG dest, LONG exch, LONG cmp)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN64
|
||||||
|
return InterlockedCompareExchange(dest, exch, cmp);
|
||||||
|
#else
|
||||||
return ice_wrapper(&InterlockedCompareExchange, dest, exch, cmp);
|
return ice_wrapper(&InterlockedCompareExchange, dest, exch, cmp);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -138,12 +139,7 @@ void call_once(void (*func)(), once_flag& flag)
|
|||||||
<< &flag
|
<< &flag
|
||||||
<< std::ends;
|
<< std::ends;
|
||||||
unfreezer unfreeze(strm);
|
unfreezer unfreeze(strm);
|
||||||
# if defined (BOOST_NO_ANSI_APIS)
|
HANDLE mutex=new_mutex(strm.str());
|
||||||
USES_CONVERSION;
|
|
||||||
HANDLE mutex = CreateMutexW(NULL, FALSE, A2CW(strm.str()));
|
|
||||||
# else
|
|
||||||
HANDLE mutex = CreateMutexA(NULL, FALSE, strm.str());
|
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
# if defined (BOOST_NO_ANSI_APIS)
|
# if defined (BOOST_NO_ANSI_APIS)
|
||||||
std::wostringstream strm;
|
std::wostringstream strm;
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2002-2003
|
// Copyright (C) 2002-2003
|
||||||
// David Moore, William E. Kempf, Michael Glassford
|
// David Moore, William E. Kempf, Michael Glassford
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PROBLEMS:
|
PROBLEMS:
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
@@ -94,6 +89,18 @@ public:
|
|||||||
bool m_started;
|
bool m_started;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
|
||||||
|
struct on_thread_exit_guard
|
||||||
|
{
|
||||||
|
~on_thread_exit_guard()
|
||||||
|
{
|
||||||
|
on_thread_exit();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // unnamed namespace
|
} // unnamed namespace
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -105,22 +112,25 @@ extern "C" {
|
|||||||
static OSStatus thread_proxy(void* param)
|
static OSStatus thread_proxy(void* param)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
try
|
// try
|
||||||
{
|
{
|
||||||
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
|
||||||
|
on_thread_exit_guard guard;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
thread_param* p = static_cast<thread_param*>(param);
|
thread_param* p = static_cast<thread_param*>(param);
|
||||||
boost::function0<void> threadfunc = p->m_threadfunc;
|
boost::function0<void> threadfunc = p->m_threadfunc;
|
||||||
p->started();
|
p->started();
|
||||||
threadfunc();
|
threadfunc();
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
|
||||||
on_thread_exit();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
|
||||||
on_thread_exit();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
// catch (...)
|
||||||
|
// {
|
||||||
|
//#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
// on_thread_exit();
|
||||||
|
//#endif
|
||||||
|
// }
|
||||||
#if defined(BOOST_HAS_MPTASKS)
|
#if defined(BOOST_HAS_MPTASKS)
|
||||||
::boost::detail::thread_cleanup();
|
::boost::detail::thread_cleanup();
|
||||||
#endif
|
#endif
|
||||||
@@ -368,7 +378,7 @@ void thread_group::join_all()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int thread_group::size()
|
int thread_group::size() const
|
||||||
{
|
{
|
||||||
return m_threads.size();
|
return m_threads.size();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
// boostinspect:nounnamed
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int MILLISECONDS_PER_SECOND = 1000;
|
const int MILLISECONDS_PER_SECOND = 1000;
|
||||||
|
|||||||
139
src/tss.cpp
139
src/tss.cpp
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003 William E. Kempf
|
||||||
// William E. Kempf
|
// Copyright (C) 2006 Roland Schwarz
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
@@ -30,62 +25,98 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
typedef std::vector<void*> tss_slots;
|
typedef std::vector<void*> tss_slots;
|
||||||
|
typedef std::vector<boost::function1<void, void*>*> tss_data_cleanup_handlers_type;
|
||||||
|
|
||||||
struct tss_data_t
|
|
||||||
{
|
|
||||||
boost::mutex mutex;
|
|
||||||
std::vector<boost::function1<void, void*>*> cleanup_handlers;
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
|
||||||
DWORD native_key;
|
|
||||||
#elif defined(BOOST_HAS_PTHREADS)
|
|
||||||
pthread_key_t native_key;
|
|
||||||
#elif defined(BOOST_HAS_MPTASKS)
|
|
||||||
TaskStorageIndex native_key;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
tss_data_t* tss_data = 0;
|
|
||||||
boost::once_flag tss_data_once = BOOST_ONCE_INIT;
|
boost::once_flag tss_data_once = BOOST_ONCE_INIT;
|
||||||
|
boost::mutex* tss_data_mutex = 0;
|
||||||
|
tss_data_cleanup_handlers_type* tss_data_cleanup_handlers = 0;
|
||||||
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
DWORD tss_data_native_key;
|
||||||
|
#elif defined(BOOST_HAS_PTHREADS)
|
||||||
|
pthread_key_t tss_data_native_key;
|
||||||
|
#elif defined(BOOST_HAS_MPTASKS)
|
||||||
|
TaskStorageIndex tss_data_native_key;
|
||||||
|
#endif
|
||||||
|
int tss_data_use = 0;
|
||||||
|
|
||||||
|
void tss_data_inc_use(boost::mutex::scoped_lock& lk)
|
||||||
|
{
|
||||||
|
++tss_data_use;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tss_data_dec_use(boost::mutex::scoped_lock& lk)
|
||||||
|
{
|
||||||
|
if (0 == --tss_data_use)
|
||||||
|
{
|
||||||
|
tss_data_cleanup_handlers_type::size_type i;
|
||||||
|
for (i = 0; i < tss_data_cleanup_handlers->size(); ++i)
|
||||||
|
{
|
||||||
|
delete (*tss_data_cleanup_handlers)[i];
|
||||||
|
}
|
||||||
|
delete tss_data_cleanup_handlers;
|
||||||
|
tss_data_cleanup_handlers = 0;
|
||||||
|
lk.unlock();
|
||||||
|
delete tss_data_mutex;
|
||||||
|
tss_data_mutex = 0;
|
||||||
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
TlsFree(tss_data_native_key);
|
||||||
|
#elif defined(BOOST_HAS_PTHREADS)
|
||||||
|
pthread_key_delete(tss_data_native_key);
|
||||||
|
#elif defined(BOOST_HAS_MPTASKS)
|
||||||
|
// Don't know what to put here.
|
||||||
|
// But MPTASKS isn't currently maintained anyways...
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" void cleanup_slots(void* p)
|
extern "C" void cleanup_slots(void* p)
|
||||||
{
|
{
|
||||||
tss_slots* slots = static_cast<tss_slots*>(p);
|
tss_slots* slots = static_cast<tss_slots*>(p);
|
||||||
|
boost::mutex::scoped_lock lock(*tss_data_mutex);
|
||||||
for (tss_slots::size_type i = 0; i < slots->size(); ++i)
|
for (tss_slots::size_type i = 0; i < slots->size(); ++i)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(tss_data->mutex);
|
(*(*tss_data_cleanup_handlers)[i])((*slots)[i]);
|
||||||
(*tss_data->cleanup_handlers[i])((*slots)[i]);
|
|
||||||
(*slots)[i] = 0;
|
(*slots)[i] = 0;
|
||||||
}
|
}
|
||||||
|
tss_data_dec_use(lock);
|
||||||
|
delete slots;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_tss_data()
|
void init_tss_data()
|
||||||
{
|
{
|
||||||
std::auto_ptr<tss_data_t> temp(new tss_data_t);
|
std::auto_ptr<tss_data_cleanup_handlers_type> temp(new tss_data_cleanup_handlers_type);
|
||||||
|
|
||||||
|
std::auto_ptr<boost::mutex> temp_mutex(new boost::mutex);
|
||||||
|
if (temp_mutex.get() == 0)
|
||||||
|
throw boost::thread_resource_error();
|
||||||
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
//Force the cleanup implementation library to be linked in
|
//Force the cleanup implementation library to be linked in
|
||||||
tss_cleanup_implemented();
|
tss_cleanup_implemented();
|
||||||
|
|
||||||
//Allocate tls slot
|
//Allocate tls slot
|
||||||
temp->native_key = TlsAlloc();
|
tss_data_native_key = TlsAlloc();
|
||||||
if (temp->native_key == 0xFFFFFFFF)
|
if (tss_data_native_key == 0xFFFFFFFF)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#elif defined(BOOST_HAS_PTHREADS)
|
#elif defined(BOOST_HAS_PTHREADS)
|
||||||
int res = pthread_key_create(&temp->native_key, &cleanup_slots);
|
int res = pthread_key_create(&tss_data_native_key, &cleanup_slots);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return;
|
return;
|
||||||
#elif defined(BOOST_HAS_MPTASKS)
|
#elif defined(BOOST_HAS_MPTASKS)
|
||||||
OSStatus status = MPAllocateTaskStorageIndex(&temp->native_key);
|
OSStatus status = MPAllocateTaskStorageIndex(&tss_data_native_key);
|
||||||
if (status != noErr)
|
if (status != noErr)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Intentional memory "leak"
|
// The life time of cleanup handlers and mutex is beeing
|
||||||
// This is the only way to ensure the mutex in the global data
|
// managed by a reference counting technique.
|
||||||
// structure is available when cleanup handlers are run, since the
|
// This avoids a memory leak by releasing the global data
|
||||||
// execution order of cleanup handlers is unspecified on any platform
|
// after last use only, since the execution order of cleanup
|
||||||
// with regards to C++ destructor ordering rules.
|
// handlers is unspecified on any platform with regards to
|
||||||
tss_data = temp.release();
|
// C++ destructor ordering rules.
|
||||||
|
tss_data_cleanup_handlers = temp.release();
|
||||||
|
tss_data_mutex = temp_mutex.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
@@ -105,13 +136,13 @@ tss_slots* get_slots(bool alloc)
|
|||||||
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
slots = static_cast<tss_slots*>(
|
slots = static_cast<tss_slots*>(
|
||||||
TlsGetValue(tss_data->native_key));
|
TlsGetValue(tss_data_native_key));
|
||||||
#elif defined(BOOST_HAS_PTHREADS)
|
#elif defined(BOOST_HAS_PTHREADS)
|
||||||
slots = static_cast<tss_slots*>(
|
slots = static_cast<tss_slots*>(
|
||||||
pthread_getspecific(tss_data->native_key));
|
pthread_getspecific(tss_data_native_key));
|
||||||
#elif defined(BOOST_HAS_MPTASKS)
|
#elif defined(BOOST_HAS_MPTASKS)
|
||||||
slots = static_cast<tss_slots*>(
|
slots = static_cast<tss_slots*>(
|
||||||
MPGetTaskStorageValue(tss_data->native_key));
|
MPGetTaskStorageValue(tss_data_native_key));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (slots == 0 && alloc)
|
if (slots == 0 && alloc)
|
||||||
@@ -121,16 +152,19 @@ tss_slots* get_slots(bool alloc)
|
|||||||
#if defined(BOOST_HAS_WINTHREADS)
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
if (at_thread_exit(&tss_thread_exit) == -1)
|
if (at_thread_exit(&tss_thread_exit) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
if (!TlsSetValue(tss_data->native_key, temp.get()))
|
if (!TlsSetValue(tss_data_native_key, temp.get()))
|
||||||
return 0;
|
return 0;
|
||||||
#elif defined(BOOST_HAS_PTHREADS)
|
#elif defined(BOOST_HAS_PTHREADS)
|
||||||
if (pthread_setspecific(tss_data->native_key, temp.get()) != 0)
|
if (pthread_setspecific(tss_data_native_key, temp.get()) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
#elif defined(BOOST_HAS_MPTASKS)
|
#elif defined(BOOST_HAS_MPTASKS)
|
||||||
if (MPSetTaskStorageValue(tss_data->native_key, temp.get()) != noErr)
|
if (MPSetTaskStorageValue(tss_data_native_key, temp.get()) != noErr)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(*tss_data_mutex);
|
||||||
|
tss_data_inc_use(lock);
|
||||||
|
}
|
||||||
slots = temp.release();
|
slots = temp.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,13 +179,14 @@ namespace detail {
|
|||||||
void tss::init(boost::function1<void, void*>* pcleanup)
|
void tss::init(boost::function1<void, void*>* pcleanup)
|
||||||
{
|
{
|
||||||
boost::call_once(&init_tss_data, tss_data_once);
|
boost::call_once(&init_tss_data, tss_data_once);
|
||||||
if (tss_data == 0)
|
if (tss_data_cleanup_handlers == 0)
|
||||||
throw thread_resource_error();
|
throw thread_resource_error();
|
||||||
boost::mutex::scoped_lock lock(tss_data->mutex);
|
boost::mutex::scoped_lock lock(*tss_data_mutex);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tss_data->cleanup_handlers.push_back(pcleanup);
|
tss_data_cleanup_handlers->push_back(pcleanup);
|
||||||
m_slot = tss_data->cleanup_handlers.size() - 1;
|
m_slot = tss_data_cleanup_handlers->size() - 1;
|
||||||
|
tss_data_inc_use(lock);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@@ -159,6 +194,12 @@ void tss::init(boost::function1<void, void*>* pcleanup)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tss::~tss()
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(*tss_data_mutex);
|
||||||
|
tss_data_dec_use(lock);
|
||||||
|
}
|
||||||
|
|
||||||
void* tss::get() const
|
void* tss::get() const
|
||||||
{
|
{
|
||||||
tss_slots* slots = get_slots(false);
|
tss_slots* slots = get_slots(false);
|
||||||
@@ -196,8 +237,8 @@ void tss::set(void* value)
|
|||||||
|
|
||||||
void tss::cleanup(void* value)
|
void tss::cleanup(void* value)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(tss_data->mutex);
|
boost::mutex::scoped_lock lock(*tss_data_mutex);
|
||||||
(*tss_data->cleanup_handlers[m_slot])(value);
|
(*(*tss_data_cleanup_handlers)[m_slot])(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#if defined(__BORLANDC__)
|
#if defined(__BORLANDC__)
|
||||||
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||||
|
#elif defined(_WIN32_WCE)
|
||||||
|
extern "C" BOOL WINAPI DllMain(HANDLE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||||
#else
|
#else
|
||||||
extern "C" BOOL WINAPI DllMain(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
extern "C" BOOL WINAPI DllMain(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
// (C) Copyright Michael Glassford 2004.
|
// (C) Copyright Michael Glassford 2004.
|
||||||
|
// Copyright (c) 2006 Peter Dimov
|
||||||
|
// Copyright (c) 2006 Anthony Williams
|
||||||
|
//
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -7,178 +10,152 @@
|
|||||||
|
|
||||||
#if defined(BOOST_HAS_WINTHREADS)
|
#if defined(BOOST_HAS_WINTHREADS)
|
||||||
|
|
||||||
#include <boost/thread/detail/tss_hooks.hpp>
|
#include <boost/thread/detail/tss_hooks.hpp>
|
||||||
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/once.hpp>
|
||||||
#include <boost/thread/once.hpp>
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
typedef std::list<thread_exit_handler> thread_exit_handlers;
|
||||||
|
|
||||||
|
const DWORD invalid_tls_key = TLS_OUT_OF_INDEXES;
|
||||||
|
DWORD tls_key = invalid_tls_key;
|
||||||
|
|
||||||
|
boost::once_flag once_init_tls_key = BOOST_ONCE_INIT;
|
||||||
|
|
||||||
|
void init_tls_key()
|
||||||
|
{
|
||||||
|
tls_key = TlsAlloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // unnamed namespace
|
||||||
|
|
||||||
|
extern "C" BOOST_THREAD_DECL int at_thread_exit( thread_exit_handler exit_handler )
|
||||||
|
{
|
||||||
|
boost::call_once( init_tls_key, once_init_tls_key );
|
||||||
|
|
||||||
|
if( tls_key == invalid_tls_key )
|
||||||
{
|
{
|
||||||
typedef std::list<thread_exit_handler> thread_exit_handlers;
|
return -1;
|
||||||
|
|
||||||
boost::once_flag once_init_threadmon_mutex = BOOST_ONCE_INIT;
|
|
||||||
boost::mutex* threadmon_mutex;
|
|
||||||
void init_threadmon_mutex(void)
|
|
||||||
{
|
|
||||||
threadmon_mutex = new boost::mutex;
|
|
||||||
if (!threadmon_mutex)
|
|
||||||
throw boost::thread_resource_error();
|
|
||||||
}
|
|
||||||
|
|
||||||
const DWORD invalid_tls_key = TLS_OUT_OF_INDEXES;
|
|
||||||
DWORD tls_key = invalid_tls_key;
|
|
||||||
|
|
||||||
unsigned long attached_thread_count = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Get the exit handlers list for the current thread from tls.
|
||||||
Calls to DllMain() and tls_callback() are serialized by the OS;
|
|
||||||
however, calls to at_thread_exit are not, so it must be protected
|
|
||||||
by a mutex. Since we already need a mutex for at_thread_exit(),
|
|
||||||
and since there is no guarantee that on_process_enter(),
|
|
||||||
on_process_exit(), on_thread_enter(), and on_thread_exit()
|
|
||||||
will be called only from DllMain() or tls_callback(), it makes
|
|
||||||
sense to protect those, too.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern "C" BOOST_THREAD_DECL int at_thread_exit(
|
thread_exit_handlers* exit_handlers =
|
||||||
thread_exit_handler exit_handler
|
static_cast< thread_exit_handlers* >( TlsGetValue( tls_key ) );
|
||||||
)
|
|
||||||
|
if( exit_handlers == 0 )
|
||||||
{
|
{
|
||||||
boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
|
// No exit handlers list was created yet.
|
||||||
boost::mutex::scoped_lock lock(*threadmon_mutex);
|
|
||||||
|
|
||||||
//Allocate a tls slot if necessary.
|
|
||||||
|
|
||||||
if (tls_key == invalid_tls_key)
|
|
||||||
tls_key = TlsAlloc();
|
|
||||||
|
|
||||||
if (tls_key == invalid_tls_key)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
//Get the exit handlers list for the current thread from tls.
|
|
||||||
|
|
||||||
thread_exit_handlers* exit_handlers =
|
|
||||||
static_cast<thread_exit_handlers*>(TlsGetValue(tls_key));
|
|
||||||
|
|
||||||
if (!exit_handlers)
|
|
||||||
{
|
|
||||||
//No exit handlers list was created yet.
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//Attempt to create a new exit handlers list.
|
|
||||||
|
|
||||||
exit_handlers = new thread_exit_handlers;
|
|
||||||
if (!exit_handlers)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
//Attempt to store the list pointer in tls.
|
|
||||||
|
|
||||||
if (TlsSetValue(tls_key, exit_handlers))
|
|
||||||
++attached_thread_count;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
delete exit_handlers;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Like the C runtime library atexit() function,
|
|
||||||
//functions should be called in the reverse of
|
|
||||||
//the order they are added, so push them on the
|
|
||||||
//front of the list.
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
exit_handlers->push_front(exit_handler);
|
// Attempt to create a new exit handlers list.
|
||||||
|
|
||||||
|
exit_handlers = new thread_exit_handlers;
|
||||||
|
|
||||||
|
if( exit_handlers == 0 )
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attempt to store the list pointer in tls.
|
||||||
|
|
||||||
|
if( !TlsSetValue( tls_key, exit_handlers ) )
|
||||||
|
{
|
||||||
|
delete exit_handlers;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (...)
|
catch( ... )
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Like the atexit() function, a result of zero
|
|
||||||
//indicates success.
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" BOOST_THREAD_DECL void on_process_enter(void)
|
// Like the C runtime library atexit() function,
|
||||||
{
|
// functions should be called in the reverse of
|
||||||
boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
|
// the order they are added, so push them on the
|
||||||
boost::mutex::scoped_lock lock(*threadmon_mutex);
|
// front of the list.
|
||||||
|
|
||||||
BOOST_ASSERT(attached_thread_count == 0);
|
try
|
||||||
|
{
|
||||||
|
exit_handlers->push_front( exit_handler );
|
||||||
|
}
|
||||||
|
catch( ... )
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" BOOST_THREAD_DECL void on_process_exit(void)
|
// Like the atexit() function, a result of zero
|
||||||
|
// indicates success.
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" BOOST_THREAD_DECL void on_process_enter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" BOOST_THREAD_DECL void on_process_exit()
|
||||||
|
{
|
||||||
|
if( tls_key != invalid_tls_key )
|
||||||
{
|
{
|
||||||
boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
|
TlsFree(tls_key);
|
||||||
boost::mutex::scoped_lock lock(*threadmon_mutex);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_ASSERT(attached_thread_count == 0);
|
extern "C" BOOST_THREAD_DECL void on_thread_enter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//Free the tls slot if one was allocated.
|
extern "C" BOOST_THREAD_DECL void on_thread_exit()
|
||||||
|
{
|
||||||
|
// Initializing tls_key here ensures its proper visibility
|
||||||
|
boost::call_once( init_tls_key, once_init_tls_key );
|
||||||
|
|
||||||
if (tls_key != invalid_tls_key)
|
// Get the exit handlers list for the current thread from tls.
|
||||||
|
|
||||||
|
if( tls_key == invalid_tls_key )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_exit_handlers* exit_handlers =
|
||||||
|
static_cast< thread_exit_handlers* >( TlsGetValue( tls_key ) );
|
||||||
|
|
||||||
|
// If a handlers list was found, invoke its handlers.
|
||||||
|
|
||||||
|
if( exit_handlers != 0 )
|
||||||
|
{
|
||||||
|
// Call each handler and remove it from the list
|
||||||
|
|
||||||
|
while( !exit_handlers->empty() )
|
||||||
{
|
{
|
||||||
TlsFree(tls_key);
|
if( thread_exit_handler exit_handler = *exit_handlers->begin() )
|
||||||
tls_key = invalid_tls_key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" BOOST_THREAD_DECL void on_thread_enter(void)
|
|
||||||
{
|
|
||||||
//boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
|
|
||||||
//boost::mutex::scoped_lock lock(*threadmon_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" BOOST_THREAD_DECL void on_thread_exit(void)
|
|
||||||
{
|
|
||||||
boost::call_once(init_threadmon_mutex, once_init_threadmon_mutex);
|
|
||||||
boost::mutex::scoped_lock lock(*threadmon_mutex);
|
|
||||||
|
|
||||||
//Get the exit handlers list for the current thread from tls.
|
|
||||||
|
|
||||||
if (tls_key == invalid_tls_key)
|
|
||||||
return;
|
|
||||||
|
|
||||||
thread_exit_handlers* exit_handlers =
|
|
||||||
static_cast<thread_exit_handlers*>(TlsGetValue(tls_key));
|
|
||||||
|
|
||||||
//If a handlers list was found, use it.
|
|
||||||
|
|
||||||
if (exit_handlers && TlsSetValue(tls_key, 0))
|
|
||||||
{
|
|
||||||
BOOST_ASSERT(attached_thread_count > 0);
|
|
||||||
--attached_thread_count;
|
|
||||||
|
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
//Call each handler and remove it from the list
|
|
||||||
|
|
||||||
while (!exit_handlers->empty())
|
|
||||||
{
|
{
|
||||||
if (thread_exit_handler exit_handler = *exit_handlers->begin())
|
(*exit_handler)();
|
||||||
(*exit_handler)();
|
|
||||||
exit_handlers->pop_front();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit_handlers->pop_front();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If TlsSetValue fails, we can't delete the list,
|
||||||
|
// since a second call to on_thread_exit will try
|
||||||
|
// to access it.
|
||||||
|
|
||||||
|
if( TlsSetValue( tls_key, 0 ) )
|
||||||
|
{
|
||||||
delete exit_handlers;
|
delete exit_handlers;
|
||||||
exit_handlers = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif //defined(BOOST_HAS_WINTHREADS)
|
#endif //defined(BOOST_HAS_WINTHREADS)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
//Definitions required by implementation
|
//Definitions required by implementation
|
||||||
|
|
||||||
#if (_MSC_VER < 1310) // 1310 == VC++ 7.1
|
#if (_MSC_VER < 1300) // 1300 == VC++ 7.0
|
||||||
typedef void (__cdecl *_PVFV)(void);
|
typedef void (__cdecl *_PVFV)(void);
|
||||||
#define INIRETSUCCESS
|
#define INIRETSUCCESS
|
||||||
#define PVAPI void
|
#define PVAPI void
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
//The .CRT$Xxx information is taken from Codeguru:
|
//The .CRT$Xxx information is taken from Codeguru:
|
||||||
//http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/
|
//http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/
|
||||||
|
|
||||||
#if (_MSC_VER >= 1310) // 1310 == VC++ 7.1
|
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
|
||||||
# pragma data_seg(push, old_seg)
|
# pragma data_seg(push, old_seg)
|
||||||
#endif
|
#endif
|
||||||
//Callback to run tls glue code first.
|
//Callback to run tls glue code first.
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
#pragma data_seg(".CRT$XTU")
|
#pragma data_seg(".CRT$XTU")
|
||||||
static _PVFV p_process_term = on_process_term;
|
static _PVFV p_process_term = on_process_term;
|
||||||
#pragma data_seg()
|
#pragma data_seg()
|
||||||
#if (_MSC_VER >= 1310) // 1310 == VC++ 7.1
|
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
|
||||||
# pragma data_seg(pop, old_seg)
|
# pragma data_seg(pop, old_seg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
DWORD volatile dw = _tls_used;
|
DWORD volatile dw = _tls_used;
|
||||||
|
|
||||||
#if (_MSC_VER < 1310) // 1310 == VC++ 7.1
|
#if (_MSC_VER < 1300) // 1300 == VC++ 7.0
|
||||||
_TLSCB* pfbegin = __xl_a;
|
_TLSCB* pfbegin = __xl_a;
|
||||||
_TLSCB* pfend = __xl_z;
|
_TLSCB* pfend = __xl_z;
|
||||||
_TLSCB* pfdst = pfbegin;
|
_TLSCB* pfdst = pfbegin;
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
@@ -27,6 +22,8 @@
|
|||||||
# include <boost/thread/detail/force_cast.hpp>
|
# include <boost/thread/detail/force_cast.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
#ifdef BOOST_HAS_MPTASKS
|
#ifdef BOOST_HAS_MPTASKS
|
||||||
@@ -111,13 +108,23 @@ int xtime_get(struct xtime* xtp, int clock_type)
|
|||||||
return clock_type;
|
return clock_type;
|
||||||
#elif defined(BOOST_HAS_GETTIMEOFDAY)
|
#elif defined(BOOST_HAS_GETTIMEOFDAY)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
# ifndef NDEBUG
|
||||||
|
int res =
|
||||||
|
#endif
|
||||||
gettimeofday(&tv, 0);
|
gettimeofday(&tv, 0);
|
||||||
|
assert(0 == res);
|
||||||
|
assert(tv.tv_sec >= 0);
|
||||||
|
assert(tv.tv_usec >= 0);
|
||||||
xtp->sec = tv.tv_sec;
|
xtp->sec = tv.tv_sec;
|
||||||
xtp->nsec = tv.tv_usec * 1000;
|
xtp->nsec = tv.tv_usec * 1000;
|
||||||
return clock_type;
|
return clock_type;
|
||||||
#elif defined(BOOST_HAS_CLOCK_GETTIME)
|
#elif defined(BOOST_HAS_CLOCK_GETTIME)
|
||||||
timespec ts;
|
timespec ts;
|
||||||
|
# ifndef NDEBUG
|
||||||
|
int res =
|
||||||
|
# endif
|
||||||
clock_gettime(CLOCK_REALTIME, &ts);
|
clock_gettime(CLOCK_REALTIME, &ts);
|
||||||
|
assert(0 == res);
|
||||||
xtp->sec = ts.tv_sec;
|
xtp->sec = ts.tv_sec;
|
||||||
xtp->nsec = ts.tv_nsec;
|
xtp->nsec = ts.tv_nsec;
|
||||||
return clock_type;
|
return clock_type;
|
||||||
|
|||||||
83
test/Jamfile
83
test/Jamfile
@@ -1,83 +0,0 @@
|
|||||||
# Copyright (C) 2001-2003
|
|
||||||
# William E. Kempf
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, distribute and sell this software
|
|
||||||
# and its documentation for any purpose is hereby granted without fee,
|
|
||||||
# provided that the above copyright notice appear in all copies and
|
|
||||||
# that both that copyright notice and this permission notice appear
|
|
||||||
# in supporting documentation. William E. Kempf makes no representations
|
|
||||||
# about the suitability of this software for any purpose.
|
|
||||||
# It is provided "as is" without express or implied warranty.
|
|
||||||
#
|
|
||||||
# Boost.Threads test Jamfile
|
|
||||||
#
|
|
||||||
# Additional configuration variables used:
|
|
||||||
# See threads.jam.
|
|
||||||
|
|
||||||
# Declare the location of this subproject relative to the root.
|
|
||||||
subproject libs/thread/test ;
|
|
||||||
|
|
||||||
# Include threads.jam for Boost.Threads global build information.
|
|
||||||
# This greatly simplifies the Jam code needed to configure the build
|
|
||||||
# for the various Win32 build types.
|
|
||||||
import ../build/threads ;
|
|
||||||
|
|
||||||
# bring in rules for testing
|
|
||||||
import testing ;
|
|
||||||
|
|
||||||
{
|
|
||||||
template boost_thread_test_lib
|
|
||||||
: ## sources ##
|
|
||||||
<template>thread_base
|
|
||||||
../src/tss_null.cpp
|
|
||||||
<lib>../build/boost_thread
|
|
||||||
<lib>../../test/build/boost_unit_test_framework
|
|
||||||
#<lib>../../test/build/boost_test_exec_monitor
|
|
||||||
: ## requirements ##
|
|
||||||
<sysinclude>$(BOOST_ROOT) #:should be unnecessary (because already included in thread_base)
|
|
||||||
<define>BOOST_ALL_NO_LIB=1
|
|
||||||
<define>BOOST_THREAD_USE_LIB=1
|
|
||||||
<define>BOOST_THREAD_TEST=1
|
|
||||||
#<runtime-link>static
|
|
||||||
<threading>multi
|
|
||||||
: ## default build ##
|
|
||||||
;
|
|
||||||
|
|
||||||
template boost_thread_test_dll
|
|
||||||
: ## sources ##
|
|
||||||
<template>thread_base
|
|
||||||
../src/tss_null.cpp
|
|
||||||
<dll>../build/boost_thread
|
|
||||||
<lib>../../test/build/boost_unit_test_framework
|
|
||||||
#<lib>../../test/build/boost_test_exec_monitor
|
|
||||||
: ## requirements ##
|
|
||||||
<sysinclude>$(BOOST_ROOT) #:should be unnecessary (because already included in thread_base)
|
|
||||||
<define>BOOST_ALL_NO_LIB=1
|
|
||||||
<define>BOOST_THREAD_USE_DLL=1
|
|
||||||
<define>BOOST_THREAD_TEST=1
|
|
||||||
<runtime-link>dynamic
|
|
||||||
<threading>multi
|
|
||||||
: ## default build ##
|
|
||||||
;
|
|
||||||
|
|
||||||
test-suite "threads"
|
|
||||||
:
|
|
||||||
[ run test_thread.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_mutex.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_condition.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_tss.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_once.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_xtime.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_barrier.cpp <template>boost_thread_test_dll ]
|
|
||||||
[ run test_read_write_mutex.cpp <template>boost_thread_test_dll ]
|
|
||||||
|
|
||||||
[ run test_thread.cpp <template>boost_thread_test_lib : : : : test_thread_lib ]
|
|
||||||
[ run test_mutex.cpp <template>boost_thread_test_lib : : : : test_mutex_lib ]
|
|
||||||
[ run test_condition.cpp <template>boost_thread_test_lib : : : : test_condition_lib ]
|
|
||||||
[ run test_tss.cpp <template>boost_thread_test_lib : : : : test_tss_lib ]
|
|
||||||
[ run test_once.cpp <template>boost_thread_test_lib : : : : test_once_lib ]
|
|
||||||
[ run test_xtime.cpp <template>boost_thread_test_lib : : : : test_xtime_lib ]
|
|
||||||
[ run test_barrier.cpp <template>boost_thread_test_lib : : : : test_barrier_lib ]
|
|
||||||
[ run test_read_write_mutex.cpp <template>boost_thread_test_lib : : : : test_read_write_mutex_lib ]
|
|
||||||
;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
# (C) Copyright William E. Kempf 2001. Permission to copy, use, modify, sell
|
# (C) Copyright William E. Kempf 2001.
|
||||||
# and distribute this software is granted provided this copyright notice
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
# appears in all copies. This software is provided "as is" without express or
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
# implied warranty, and with no claim as to its suitability for any purpose.
|
|
||||||
#
|
#
|
||||||
# Boost.Threads test Jamfile
|
# Boost.Threads test Jamfile
|
||||||
#
|
#
|
||||||
@@ -19,7 +18,7 @@
|
|||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
project
|
project
|
||||||
: requirements <library>../../test/build//boost_unit_test_framework
|
: requirements <library>/boost/test//boost_unit_test_framework/<link>static
|
||||||
<threading>multi
|
<threading>multi
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ rule thread-run ( sources )
|
|||||||
{
|
{
|
||||||
return
|
return
|
||||||
[ run $(sources) ../build//boost_thread ]
|
[ run $(sources) ../build//boost_thread ]
|
||||||
[ run $(sources) ../build//boost_thread/<link>static
|
[ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
|
||||||
: : : : $(sources[1]:B)_lib ]
|
: : : : $(sources[1]:B)_lib ]
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
@@ -149,7 +144,12 @@ void do_test_tss()
|
|||||||
<< "\n";
|
<< "\n";
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(tss_instances, 0);
|
// The following is not really an error. TSS cleanup support still is available
|
||||||
|
// for threads, launched via the boost API. Also this usually will be triggered
|
||||||
|
// only when bound to the static version of the thread lib.
|
||||||
|
// 2006-10-15 Roland Schwarz
|
||||||
|
//BOOST_CHECK_EQUAL(tss_instances, 0);
|
||||||
|
BOOST_CHECK_MESSAGE(tss_instances ==0, "Support of automatic tss cleanup for native threading API not available");
|
||||||
BOOST_CHECK_EQUAL(tss_total, 5);
|
BOOST_CHECK_EQUAL(tss_total, 5);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/detail/config.hpp>
|
#include <boost/thread/detail/config.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#if !defined(UTIL_INL_WEK01242003)
|
#if !defined(UTIL_INL_WEK01242003)
|
||||||
#define UTIL_INL_WEK01242003
|
#define UTIL_INL_WEK01242003
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
# Copyright (C) 2001-2003
|
# Copyright (C) 2001-2003
|
||||||
# William E. Kempf
|
# William E. Kempf
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, distribute and sell this software
|
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
# and its documentation for any purpose is hereby granted without fee,
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
# provided that the above copyright notice appear in all copies and
|
|
||||||
# that both that copyright notice and this permission notice appear
|
|
||||||
# in supporting documentation. William E. Kempf makes no representations
|
|
||||||
# about the suitability of this software for any purpose.
|
|
||||||
# It is provided "as is" without express or implied warranty.
|
|
||||||
#
|
#
|
||||||
# Boost.Threads tutorial Jamfile
|
# Boost.Threads tutorial Jamfile
|
||||||
#
|
#
|
||||||
@@ -21,34 +16,19 @@
|
|||||||
# variant to link against (see the pthreads-win32 documentation).
|
# variant to link against (see the pthreads-win32 documentation).
|
||||||
# Example: jam -sPTW32="c:\pthreads-win32 pthreadVCE.lib"
|
# Example: jam -sPTW32="c:\pthreads-win32 pthreadVCE.lib"
|
||||||
|
|
||||||
# Declare the location of this subproject relative to the root.
|
project
|
||||||
|
: requirements <library>/boost/thread//boost_thread
|
||||||
subproject libs/thread/tutorial ;
|
<threading>multi
|
||||||
|
|
||||||
# Include threads.jam for Boost.Threads global build information.
|
|
||||||
# This greatly simplifies the Jam code needed to configure the build
|
|
||||||
# for the various Win32 build types.
|
|
||||||
import ../build/threads ;
|
|
||||||
|
|
||||||
{
|
|
||||||
template tutorial
|
|
||||||
## sources ##
|
|
||||||
: <template>thread_base
|
|
||||||
<dll>../build/boost_thread
|
|
||||||
## requirements ##
|
|
||||||
:
|
|
||||||
## default build ##
|
|
||||||
:
|
|
||||||
;
|
;
|
||||||
|
|
||||||
exe helloworld : <template>tutorial helloworld.cpp ;
|
exe helloworld : helloworld.cpp ;
|
||||||
exe helloworld2 : <template>tutorial helloworld2.cpp ;
|
exe helloworld2 : helloworld2.cpp ;
|
||||||
exe helloworld3 : <template>tutorial helloworld3.cpp ;
|
exe helloworld3 : helloworld3.cpp ;
|
||||||
exe helloworld4 : <template>tutorial helloworld4.cpp ;
|
exe helloworld4 : helloworld4.cpp ;
|
||||||
exe factorial : <template>tutorial factorial.cpp ;
|
exe factorial : factorial.cpp ;
|
||||||
exe factorial2 : <template>tutorial factorial2.cpp ;
|
exe factorial2 : factorial2.cpp ;
|
||||||
exe factorial3 : <template>tutorial factorial3.cpp ;
|
exe factorial3 : factorial3.cpp ;
|
||||||
exe counter : <template>tutorial counter.cpp ;
|
exe counter : counter.cpp ;
|
||||||
exe bounded_buffer : <template>tutorial bounded_buffer.cpp ;
|
exe bounded_buffer : bounded_buffer.cpp ;
|
||||||
exe once : <template>tutorial once.cpp ;
|
exe once : once.cpp ;
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/condition.hpp>
|
#include <boost/thread/condition.hpp>
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/once.hpp>
|
#include <boost/thread/once.hpp>
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
// Copyright (C) 2001-2003
|
// Copyright (C) 2001-2003
|
||||||
// William E. Kempf
|
// William E. Kempf
|
||||||
//
|
//
|
||||||
// Permission to use, copy, modify, distribute and sell this software
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// and its documentation for any purpose is hereby granted without fee,
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
// provided that the above copyright notice appear in all copies and
|
|
||||||
// that both that copyright notice and this permission notice appear
|
|
||||||
// in supporting documentation. William E. Kempf makes no representations
|
|
||||||
// about the suitability of this software for any purpose.
|
|
||||||
// It is provided "as is" without express or implied warranty.
|
|
||||||
|
|
||||||
#include <boost/thread/thread.hpp>
|
#include <boost/thread/thread.hpp>
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user