2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-06 22:42:13 +00:00

Compare commits

...

73 Commits

Author SHA1 Message Date
Andrey Semashev
ac15f907be Fix warnings about missing sized deallocation operator in C++14 mode. 2026-02-06 15:45:40 +03:00
Andrey Semashev
e2f6e8789f Fixed uninitialized variable warnings. 2026-02-06 15:21:11 +03:00
Andrey Semashev
24917577d7 Silence unused variable warnings. 2026-02-06 15:14:21 +03:00
Andrey Semashev
6da5c6d418 Updated no_exceptions_support.hpp include to the up-to-date location. 2026-02-06 15:08:13 +03:00
Andrey Semashev
de9eb0ee7d Fix signed/unsigned a mismatch warning. 2026-02-06 15:06:51 +03:00
Andrey Semashev
f19c0d3b56 Removed usage of deprecated Boost.Test header. 2026-02-06 15:05:38 +03:00
Andrey Semashev
3d95d2366e Optimize run_it construction/assignment from rvalue references.
Also fix code indentation.
2026-02-06 14:58:10 +03:00
Andrey Semashev
ed7171099b Silence MSVC warning about unreferenced formal parameter.
Closes https://github.com/boostorg/thread/pull/382.
2026-02-06 14:34:14 +03:00
Andrey Semashev
36f63a1b63 Merge pull request #331 from marcusb/patch-1
Non-template function needs inline
2026-02-06 14:05:38 +03:00
Andrey Semashev
2a953f1c4b Merge pull request #309 from Lastique/fix_bind_warnings
Cleanup header includes
2026-02-06 14:04:41 +03:00
Andrey Semashev
c34d1fd2d9 Merge pull request #327 from giomasce-throwaway/develop
Fix typos in copyright headers.
2026-02-06 14:00:01 +03:00
Andrey Semashev
be42bd8d10 Merge pull request #398 from georgthegreat/patch-1
Use forward slashes to separate include files
2026-02-06 13:58:36 +03:00
Andrey Semashev
45e77a932f Merge pull request #401 from bazelboost/add-missing-assert-header
add missing assert header in pthreads_helpers.hpp
2026-02-06 13:57:07 +03:00
Andrey Semashev
b712fac6cc Merge pull request #417 from Lastique/feature/remove_static_assert
Remove dependencies on Boost.StaticAssert
2026-02-06 13:55:25 +03:00
Andrey Semashev
ca6b6affec Remove dependencies on Boost.StaticAssert.
Boost.StaticAssert has been merged into Boost.Config, so remove
the dependency.
2026-01-22 19:47:42 +03:00
Peter Dimov
a1f89c9518 Merge pull request #403 from grafikrobot/modular
Add support for modular build structure.
2025-05-02 19:21:55 +03:00
Rene Rivera
28d58852bb Move the include usage req to the library build target. 2025-04-14 20:26:31 -05:00
Rene Rivera
4e0a88853a Sync from upstream. 2025-04-04 21:39:22 -05:00
Peter Dimov
5d68c9c42c Merge pull request #408 from arvid-norlander/bugfix/fix-build-on-clang-19
Fix build on clang-19
2025-03-12 04:05:27 +02:00
Peter Dimov
b3183638cb Update ci.yml 2025-03-12 03:19:41 +02:00
Peter Dimov
48482ff696 Apply Node20 workaround 2024-12-15 20:49:55 +02:00
Peter Dimov
76411e5918 Update ci.yml 2024-12-15 20:49:55 +02:00
Arvid Norlander
49ccf9c30a Fix build on clang-19 (which checks more things in uninstantiated templates)
Fixes issue #402
2024-11-08 16:48:43 +01:00
Rene Rivera
814ed9f341 Update build deps. 2024-08-09 22:26:06 -05:00
Rene Rivera
82aa252a9e Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:22 -05:00
Rene Rivera
b1ff784e51 Update copyright dates. 2024-07-20 22:52:03 -05:00
Rene Rivera
e6e4e53807 Bump B2 require to 5.2 2024-06-14 11:33:56 -05:00
Rene Rivera
0fc00ec05c Update dependencies. 2024-05-13 21:47:48 -05:00
Rene Rivera
435a623e48 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Ezekiel Warren
0a8c93842e fix: modify pthread_helpers adding missing assert header 2024-04-30 00:18:27 -07:00
Rene Rivera
ca4b54f96c Add missing NO_LIB usage requirements. 2024-04-28 20:17:11 -05:00
Rene Rivera
43bfe9cbd2 Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:16:00 -05:00
Rene Rivera
691b64d5aa Put back removing qualified boostcpp tag. As we need it until the Jamroot removes the qualified tag. 2024-03-17 18:34:13 -05:00
Rene Rivera
e2de571359 Make the library modular usable. 2024-03-11 08:38:17 -05:00
Yuriy Chernyshov
8811487643 Use forward slashes to separate include files
We use automatic dependency tracking for #includes, and wrl includes have to be tracked differently whenever we are cross-compiling the code.

This PR unifies such tracking. Forward slashes work just fine on Windows.
2024-02-04 13:03:02 +01:00
Peter Dimov
aec18d337f Update CMakeLists.txt 2023-10-15 16:17:36 +03:00
Peter Dimov
54a28e4d54 Remove MinGW (non w64) from Appveyor 2023-10-14 18:51:29 +03:00
Peter Dimov
9d73a06e06 Add missing include 2023-10-14 04:12:09 +03:00
Peter Dimov
527a56f242 Remove dependency on Iterator 2023-10-14 03:52:02 +03:00
Peter Dimov
f1003a9a5f Remove dependency on LexicalCast 2023-10-14 03:25:40 +03:00
Peter Dimov
710e6fd278 Add boost/thread/detail/string_to_unsigned.hpp 2023-10-14 03:21:14 +03:00
Peter Dimov
5cbc8db036 Eliminate dependency on Algorithm 2023-10-14 02:59:25 +03:00
Peter Dimov
caa7c111d2 Add boost/thread/detail/string_trim.hpp 2023-10-14 02:53:15 +03:00
Peter Dimov
a513e53043 Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 2023-10-14 01:42:25 +03:00
Peter Dimov
5fb09cd1c1 std::make_unique is C++14 2023-10-13 21:26:18 +03:00
Peter Dimov
515d95c441 Remove workarounds from csbl headers to reduce dependencies 2023-10-13 19:46:06 +03:00
Peter Dimov
32d8199b6c Update meta/libraries.json 2023-10-13 19:24:23 +03:00
Peter Dimov
d0264d6813 Merge branch 'develop' into feature/appveyor 2023-09-13 13:30:52 +03:00
Peter Dimov
cf06d84362 Merge pull request #394 from Lastique/patch-6
Update declval.hpp include
2023-09-13 12:36:52 +03:00
Peter Dimov
ccc5e3142c Further increase test timeout 2023-09-13 11:08:17 +03:00
Peter Dimov
97060416f1 Remove MinGW from Appveyor because of an internal compiler error 2023-09-13 10:06:26 +03:00
Peter Dimov
88e32fd1ac Add cxxstd=11 to MinGW on Appveyor 2023-09-13 01:55:20 +03:00
Andrey Semashev
5f41e68838 Update declval.hpp include.
The header is part of Boost.TypeTraits, so use the appropriate header path.
2023-09-11 21:15:28 +03:00
Peter Dimov
7d570f70d8 Remove msvc-12.0 from Appveyor 2023-09-11 19:32:44 +03:00
Peter Dimov
e62d29f917 Merge branch 'feature/pr-393' into develop 2023-09-11 19:14:36 +03:00
Peter Dimov
09f01fbb05 Merge branch 'invoke_swap' of https://github.com/Flamefire/thread into feature/pr-393 2023-09-11 17:06:57 +03:00
Peter Dimov
fadb514c71 Merge branch 'win32-clang-tsa-annotations' of https://github.com/Kojoley/thread into feature/pr-386 2023-09-11 16:58:12 +03:00
Peter Dimov
30dcb6dcbc Update ci.yml 2023-09-11 15:58:17 +03:00
Alexander Grund
27cb703930 Use boost::core::invoke_swap instead of deprecated boost::swap 2023-09-11 09:30:45 +02:00
Nikita Kniazev
d56f3f25ad Win32 Clang TSA annotations. Fixes #321 2023-04-23 02:03:50 +03:00
Peter Dimov
52b62ee7b0 Update ci.yml 2023-01-01 03:23:17 +02:00
Peter Dimov
78af23ca14 Remove tabs 2022-12-31 20:01:31 +02:00
Peter Dimov
743d19d7d3 Update ci.yml 2022-07-05 21:47:52 +03:00
Peter Dimov
7f7faf234d Merge branch 'develop' of https://github.com/mbs-c/thread into feature/pr-324 2022-07-05 20:50:14 +03:00
Peter Dimov
1de55fceda Fix test_366_4.cpp 2022-05-14 17:26:50 +03:00
Peter Dimov
8db325363b Disable interruptions in ~thread_guard, ~scoped_thread, ~strict_scoped_thread (refs #366, #367, #369) 2022-05-13 21:49:14 +03:00
Peter Dimov
f71e0f1645 Add test cases for issue #366 (also see comments in #367 and #369) 2022-05-13 21:41:54 +03:00
Peter Dimov
7f36ea346f Merge pull request #336 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-10-26 16:59:32 +03:00
Edward Diener
c55e0952ee [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-21 16:22:48 -05:00
Marcus Better
7e2cd262ce Non-template function needs inline
This is to prevent multiple definition of the symbol when the file is included from multiple modules.
2020-12-07 21:23:44 -05:00
Giovanni Mascellani
637ceec996 Fix typos in copyright headers. 2020-10-11 17:34:08 +02:00
Moritz Baumann
4bc126fc37 Update calling convention macros in thread_primitives.cpp 2020-08-11 10:07:39 +02:00
Andrey Semashev
ee609e8806 Cleanup header includes.
1. Make inclusion of boost/bind/bind.hpp conditional in some cases, when the
   code actually conditionally uses boost::bind. Reduces compile-time overhead
   and fixes https://github.com/boostorg/thread/issues/307.

2. Remove some unnecessary uses of boost::ref. This allows to avoid including
   boost/core/ref.hpp in a few places, and avoids the associated template
   instantiation overhead in others.

3. Replace deprecated header includes with the more recent alternatives. For
   example: boost/detail/lightweight_test.hpp -> boost/core/lightweight_test.hpp,
   boost/ref.hpp -> boost/core/ref.hpp.

4. Replace some blanket includes with the more fine-grained ones. For example,
   boost/utility.hpp, boost/atomic.hpp. This reduces compile time overhead.

5. Add some missing includes, for example, boost/core/ref.hpp and
   boost/type_traits/is_same.hpp.

6. Replace uses of std::is_same with boost::is_same (with the corresponding
   included header) since the standard type_traits header presence and validity
   is not tested by the code. Using boost::is_same makes the code more portable.
2020-04-05 01:51:58 +03:00
408 changed files with 1177 additions and 793 deletions

View File

@@ -18,35 +18,77 @@ jobs:
matrix: matrix:
include: include:
- toolset: gcc-4.8 - toolset: gcc-4.8
os: ubuntu-18.04 cxxstd: 11
container: ubuntu:18.04
os: ubuntu-latest
install: g++-4.8 install: g++-4.8
- toolset: gcc-5 - toolset: gcc-5
cxxstd: 11 cxxstd: 11
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: g++-5 install: g++-5
- toolset: gcc-7 - toolset: gcc-7
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
- toolset: gcc-9 - toolset: gcc-9
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
- toolset: gcc-11 - toolset: gcc-11
os: ubuntu-20.04 os: ubuntu-22.04
install: g++-11 - toolset: gcc-13
os: ubuntu-24.04
- toolset: clang
container: ubuntu:20.04
os: ubuntu-latest
install: clang
- toolset: clang
os: ubuntu-22.04
- toolset: clang - toolset: clang
compiler: clang++-12
cxxstd: 20 cxxstd: 20
os: ubuntu-20.04 os: ubuntu-24.04
install: clang-12
- toolset: clang - toolset: clang
os: macos-10.15 os: macos-13
cxxstd: 11
- toolset: clang
os: macos-14
cxxstd: 14
- toolset: clang
os: macos-15
cxxstd: 17
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
defaults:
run:
shell: bash
steps: steps:
- uses: actions/checkout@v2 - name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++ curl xz-utils
- name: Install nodejs20glibc2.17
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
run: |
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- uses: actions/checkout@v4
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install
run: sudo apt install ${{matrix.install}} run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost - name: Setup Boost
run: | run: |
@@ -66,7 +108,7 @@ jobs:
cd boost-root cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh ./bootstrap.sh
./b2 -d0 headers ./b2 -d0 headers

View File

@@ -1,9 +1,9 @@
# Generated by `boostdep --cmake thread` # Generated by `boostdep --cmake thread`
# Copyright 2020 Peter Dimov # Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt # https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16) cmake_minimum_required(VERSION 3.8...3.20)
project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -63,15 +63,12 @@ target_link_libraries(boost_thread
Boost::date_time Boost::date_time
Boost::exception Boost::exception
Boost::function Boost::function
Boost::intrusive
Boost::io Boost::io
Boost::iterator
Boost::move Boost::move
Boost::optional Boost::optional
Boost::predef Boost::predef
Boost::preprocessor Boost::preprocessor
Boost::smart_ptr Boost::smart_ptr
Boost::static_assert
Boost::system Boost::system
Boost::throw_exception Boost::throw_exception
Boost::tuple Boost::tuple
@@ -80,12 +77,10 @@ target_link_libraries(boost_thread
Boost::winapi Boost::winapi
Threads::Threads Threads::Threads
PRIVATE
Boost::algorithm
Boost::lexical_cast
) )
target_compile_features(boost_thread PUBLIC cxx_std_11)
target_compile_definitions(boost_thread target_compile_definitions(boost_thread
PUBLIC BOOST_THREAD_NO_LIB PUBLIC BOOST_THREAD_NO_LIB
PRIVATE BOOST_THREAD_SOURCE PRIVATE BOOST_THREAD_SOURCE
@@ -102,4 +97,3 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test) add_subdirectory(test)
endif() endif()

View File

@@ -18,9 +18,6 @@ image: Visual Studio 2015
environment: environment:
matrix: matrix:
- TOOLSET: msvc-12.0
VARIANT: release
- TOOLSET: msvc-14.0 - TOOLSET: msvc-14.0
ADDRMD: 32 ADDRMD: 32
VARIANT: debug VARIANT: debug
@@ -45,23 +42,17 @@ environment:
TOOLSET: gcc TOOLSET: gcc
VARIANT: release VARIANT: release
- ADDPATH: C:\mingw\bin; - ADDPATH: C:\cygwin64\bin;
TOOLSET: gcc TOOLSET: gcc
VARIANT: debug VARIANT: debug
# The following configurations fail with - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
# ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039 TOOLSET: gcc
# https://sourceforge.net/p/mingw-w64/bugs/694/ VARIANT: debug
#
# - ADDPATH: C:\cygwin64\bin; - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
# TOOLSET: gcc TOOLSET: gcc
# VARIANT: debug VARIANT: release
# - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
# TOOLSET: gcc
# VARIANT: debug
# - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
# TOOLSET: gcc
# VARIANT: debug,release
install: install:
- set GIT_FETCH_JOBS=8 - set GIT_FETCH_JOBS=8

45
build.jam Normal file
View File

@@ -0,0 +1,45 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/assert//boost_assert
/boost/atomic//boost_atomic
/boost/bind//boost_bind
/boost/chrono//boost_chrono
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/container//boost_container
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/date_time//boost_date_time
/boost/exception//boost_exception
/boost/function//boost_function
/boost/io//boost_io
/boost/move//boost_move
/boost/optional//boost_optional
/boost/predef//boost_predef
/boost/preprocessor//boost_preprocessor
/boost/smart_ptr//boost_smart_ptr
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility
/boost/winapi//boost_winapi ;
project /boost/thread
;
explicit
[ alias boost_thread : build//boost_thread ]
[ alias all : boost_thread example test ]
;
call-if : boost-library thread
: install boost_thread
;

View File

@@ -35,18 +35,22 @@
import os ; import os ;
import indirect ; import indirect ;
import path ; import path ;
import configure ; import configure ;
import threadapi-feature ; import threadapi-feature ;
exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ; exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;
project boost/thread project
: source-location ../src : source-location ../src
: common-requirements
<library>$(boost_dependencies)
<include>../include
: requirements <threading>multi : requirements <threading>multi
#<link>static:<define>BOOST_THREAD_STATIC_LINK=1 #<link>static:<define>BOOST_THREAD_STATIC_LINK=1
#<link>shared:<define>BOOST_THREAD_DYN_LINK=1 #<link>shared:<define>BOOST_THREAD_DYN_LINK=1
<link>static:<define>BOOST_THREAD_BUILD_LIB=1 <link>static:<define>BOOST_THREAD_BUILD_LIB=1
<link>shared:<define>BOOST_THREAD_BUILD_DLL=1 <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
-<tag>@%boostcpp.tag
-<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
<tag>@$(__name__).tag <tag>@$(__name__).tag
<toolset>gcc:<cxxflags>-Wno-long-long <toolset>gcc:<cxxflags>-Wno-long-long
@@ -139,6 +143,7 @@ project boost/thread
#<define>BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED #<define>BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
#<define>BOOST_SYSTEM_NO_DEPRECATED #<define>BOOST_SYSTEM_NO_DEPRECATED
#<define>BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS #<define>BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
<define>BOOST_THREAD_NO_LIB=1
; ;
rule tag ( name : type ? : property-set ) rule tag ( name : type ? : property-set )
@@ -156,8 +161,15 @@ rule tag ( name : type ? : property-set )
} }
# forward to the boost tagging rule # forward to the boost tagging rule
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag if $(BOOST_JAMROOT_MODULE)
$(result) : $(type) : $(property-set) ] ; {
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
$(result) : $(type) : $(property-set) ] ;
}
else
{
return $(result) ;
}
} }
rule win32_pthread_paths ( properties * ) rule win32_pthread_paths ( properties * )
@@ -269,10 +281,10 @@ rule requirements ( properties * )
} }
} }
result += <define>BOOST_THREAD_DONT_USE_CHRONO ; result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
if ! [ configure.builds has_atomic_flag_lockfree if ! [ configure.builds has_atomic_flag_lockfree
: $(properties) : "lockfree boost::atomic_flag" ] { : $(properties) : "lockfree boost::atomic_flag" ] {
result += <library>/boost/atomic//boost_atomic ; result += <library>/boost/atomic//boost_atomic ;
} }
} else { } else {
if <threadapi>win32 in $(properties) if <threadapi>win32 in $(properties)
{ {
@@ -315,5 +327,3 @@ lib boost_thread
<link>static:<define>BOOST_THREAD_USE_LIB=1 <link>static:<define>BOOST_THREAD_USE_LIB=1
<conditional>@usage-requirements <conditional>@usage-requirements
; ;
boost-install boost_thread ;

View File

@@ -1,5 +1,5 @@
[/ [/
(C) Copyright 20012 Vicente J. Botet Escriba. (C) Copyright 2012 Vicente J. Botet Escriba.
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt). http://www.boost.org/LICENSE_1_0.txt).

View File

@@ -1,6 +1,6 @@
[/ [/
(C) Copyright 2007-12 Anthony Williams. (C) Copyright 2007-12 Anthony Williams.
(C) Copyright 20012 Vicente J. Botet Escriba. (C) Copyright 2012 Vicente J. Botet Escriba.
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt). http://www.boost.org/LICENSE_1_0.txt).

View File

@@ -1,6 +1,6 @@
[/ [/
(C) Copyright 2008-9 Anthony Williams. (C) Copyright 2008-9 Anthony Williams.
(C) Copyright 12 Vicente J. Botet Escriba. (C) Copyright 2012 Vicente J. Botet Escriba.
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt). http://www.boost.org/LICENSE_1_0.txt).

View File

@@ -4,7 +4,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying # 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) # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
project boost/thread/example project
: requirements <library>../build//boost_thread <threading>multi : requirements <library>../build//boost_thread <threading>multi
; ;

View File

@@ -12,6 +12,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#include <boost/core/ref.hpp>
#include <boost/thread/detail/config.hpp> #include <boost/thread/detail/config.hpp>
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
@@ -187,7 +188,7 @@ namespace detail
template <class ValueType, class Queue> template <class ValueType, class Queue>
bool sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk) bool sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
{ {
cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))); cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
if (! empty(lk)) return false; // success if (! empty(lk)) return false; // success
return true; // closed return true; // closed
} }
@@ -196,7 +197,7 @@ namespace detail
template <class WClock, class Duration> template <class WClock, class Duration>
queue_op_status sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp) queue_op_status sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
{ {
if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)))) if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
return queue_op_status::timeout; return queue_op_status::timeout;
if (! empty(lk)) return queue_op_status::success; if (! empty(lk)) return queue_op_status::success;
return queue_op_status::closed; return queue_op_status::closed;

View File

@@ -12,6 +12,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#include <boost/core/ref.hpp>
#include <boost/thread/detail/config.hpp> #include <boost/thread/detail/config.hpp>
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
@@ -187,7 +188,7 @@ namespace detail
template <class ValueType, class Queue> template <class ValueType, class Queue>
bool sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk) bool sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
{ {
cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))); cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
if (! empty(lk)) return false; // success if (! empty(lk)) return false; // success
return true; // closed return true; // closed
} }
@@ -196,7 +197,7 @@ namespace detail
template <class WClock, class Duration> template <class WClock, class Duration>
queue_op_status sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp) queue_op_status sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
{ {
if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)))) if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
return queue_op_status::timeout; return queue_op_status::timeout;
if (! empty(lk)) return queue_op_status::success; if (! empty(lk)) return queue_op_status::success;
return queue_op_status::closed; return queue_op_status::closed;

View File

@@ -9,37 +9,14 @@
#ifndef BOOST_CSBL_DEQUE_HPP #ifndef BOOST_CSBL_DEQUE_HPP
#define BOOST_CSBL_DEQUE_HPP #define BOOST_CSBL_DEQUE_HPP
#include <boost/config.hpp>
// MSVC has some trouble instantiating a non_copyable type
//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable'
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable'
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable'
// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)'
// with
// [
// _Ty=non_copyable
// ]
#if defined BOOST_THREAD_USES_BOOST_DEQUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827)
#ifndef BOOST_THREAD_USES_BOOST_DEQUE
#define BOOST_THREAD_USES_BOOST_DEQUE
#endif
#include <boost/container/deque.hpp>
#else
#include <deque> #include <deque>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_DEQUE
using ::boost::container::deque;
#else
using ::std::deque; using ::std::deque;
#endif
} }
} }
#endif // header #endif // header

View File

@@ -9,24 +9,12 @@
#ifndef BOOST_CSBL_FUNCTIONAL_HPP #ifndef BOOST_CSBL_FUNCTIONAL_HPP
#define BOOST_CSBL_FUNCTIONAL_HPP #define BOOST_CSBL_FUNCTIONAL_HPP
#include <boost/config.hpp>
#include <functional> #include <functional>
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL || defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#ifndef BOOST_THREAD_USES_BOOST_FUNCTIONAL
#define BOOST_THREAD_USES_BOOST_FUNCTIONAL
#endif
#include <boost/function.hpp>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL
using ::boost::function;
#else
// D.8.1, base (deprecated): // D.8.1, base (deprecated):
// 20.9.3, reference_wrapper: // 20.9.3, reference_wrapper:
// 20.9.4, arithmetic operations: // 20.9.4, arithmetic operations:
@@ -42,8 +30,7 @@ namespace boost
// 20.9.11 polymorphic function wrappers: // 20.9.11 polymorphic function wrappers:
using ::std::function; using ::std::function;
// 20.9.12, hash function primary template: // 20.9.12, hash function primary template:
#endif
} }
} }
#endif // header #endif // header

View File

@@ -9,27 +9,14 @@
#ifndef BOOST_CSBL_LIST_HPP #ifndef BOOST_CSBL_LIST_HPP
#define BOOST_CSBL_LIST_HPP #define BOOST_CSBL_LIST_HPP
#include <boost/config.hpp>
#if defined BOOST_THREAD_USES_BOOST_LIST || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#ifndef BOOST_THREAD_USES_BOOST_LIST
#define BOOST_THREAD_USES_BOOST_LIST
#endif
#include <boost/container/list.hpp>
#else
#include <list> #include <list>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_LIST
using ::boost::container::list;
#else
using ::std::list; using ::std::list;
#endif
} }
} }
#endif // header #endif // header

View File

@@ -12,18 +12,7 @@
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
// 20.7.6, allocator argument tag // 20.7.6, allocator argument tag
#if defined BOOST_NO_CXX11_ALLOCATOR
#include <boost/container/scoped_allocator.hpp>
namespace boost
{
namespace csbl
{
using ::boost::container::allocator_arg_t;
using ::boost::container::allocator_arg;
}
}
#else
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -32,10 +21,11 @@ namespace boost
using ::std::allocator_arg; using ::std::allocator_arg;
} }
} }
#endif // BOOST_NO_CXX11_ALLOCATOR
namespace boost namespace boost
{ {
using ::boost::csbl::allocator_arg_t; using ::boost::csbl::allocator_arg_t;
using ::boost::csbl::allocator_arg; using ::boost::csbl::allocator_arg;
} }
#endif // header #endif // header

View File

@@ -12,17 +12,7 @@
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
// 20.7.8, allocator traits // 20.7.8, allocator traits
#if defined BOOST_NO_CXX11_ALLOCATOR
#include <boost/container/allocator_traits.hpp>
namespace boost
{
namespace csbl
{
using ::boost::container::allocator_traits;
}
}
#else
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -30,6 +20,5 @@ namespace boost
using ::std::allocator_traits; using ::std::allocator_traits;
} }
} }
#endif // BOOST_NO_CXX11_POINTER_TRAITS
#endif // header #endif // header

View File

@@ -9,8 +9,6 @@
#ifndef BOOST_CSBL_MEMORY_CONFIG_HPP #ifndef BOOST_CSBL_MEMORY_CONFIG_HPP
#define BOOST_CSBL_MEMORY_CONFIG_HPP #define BOOST_CSBL_MEMORY_CONFIG_HPP
#include <boost/config.hpp>
#include <memory> #include <memory>
#endif // header #endif // header

View File

@@ -14,17 +14,6 @@
// 20.8.1 class template unique_ptr: // 20.8.1 class template unique_ptr:
// default_delete // default_delete
#if defined BOOST_NO_CXX11_SMART_PTR
#include <boost/move/unique_ptr.hpp>
namespace boost
{
namespace csbl
{
using ::boost::movelib::default_delete;
}
}
#else
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -32,10 +21,5 @@ namespace boost
using ::std::default_delete; using ::std::default_delete;
} }
} }
#endif // defined BOOST_NO_CXX11_SMART_PTR
namespace boost
{
using ::boost::csbl::default_delete;
}
#endif // header #endif // header

View File

@@ -12,17 +12,7 @@
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
// 20.7.3, pointer traits // 20.7.3, pointer traits
#if defined BOOST_NO_CXX11_ALLOCATOR
#include <boost/intrusive/pointer_traits.hpp>
namespace boost
{
namespace csbl
{
using ::boost::intrusive::pointer_traits;
}
}
#else
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -30,6 +20,5 @@ namespace boost
using ::std::pointer_traits; using ::std::pointer_traits;
} }
} }
#endif // BOOST_NO_CXX11_ALLOCATOR
#endif // header #endif // header

View File

@@ -12,17 +12,7 @@
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
// 20.7.7, uses_allocator // 20.7.7, uses_allocator
#if defined BOOST_NO_CXX11_ALLOCATOR
#include <boost/container/scoped_allocator.hpp>
namespace boost
{
namespace csbl
{
using ::boost::container::uses_allocator;
}
}
#else
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -30,6 +20,5 @@ namespace boost
using ::std::uses_allocator; using ::std::uses_allocator;
} }
} }
#endif // BOOST_NO_CXX11_POINTER_TRAITS
#endif // header #endif // header

View File

@@ -11,24 +11,6 @@
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
#if defined BOOST_NO_CXX11_SMART_PTR
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared.hpp>
namespace boost
{
namespace csbl
{
using ::boost::shared_ptr;
using ::boost::make_shared;
}
}
#else
#include <boost/shared_ptr.hpp>
namespace boost namespace boost
{ {
namespace csbl namespace csbl
@@ -38,5 +20,4 @@ namespace boost
} }
} }
#endif
#endif // header #endif // header

View File

@@ -12,17 +12,15 @@
#define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP #define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
#include <boost/thread/csbl/memory/config.hpp> #include <boost/thread/csbl/memory/config.hpp>
#include <boost/smart_ptr/make_unique.hpp>
#include <boost/move/unique_ptr.hpp>
#include <boost/move/make_unique.hpp>
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
using ::boost::movelib::unique_ptr; using ::std::unique_ptr;
using ::boost::movelib::make_unique; using ::boost::make_unique;
} }
} }
#endif // header #endif // header

View File

@@ -5,42 +5,18 @@
// //
// 2013/10 Vicente J. Botet Escriba // 2013/10 Vicente J. Botet Escriba
// Creation. // Creation.
#if 0
#ifndef BOOST_CSBL_QUEUE_HPP #ifndef BOOST_CSBL_QUEUE_HPP
#define BOOST_CSBL_QUEUE_HPP #define BOOST_CSBL_QUEUE_HPP
#include <boost/config.hpp>
// MSVC has some trouble instantiating a non_copyable type
//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable'
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable'
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable'
// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)'
// with
// [
// _Ty=non_copyable
// ]
#if defined BOOST_THREAD_USES_BOOST_QUEUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827)
#ifndef BOOST_THREAD_USES_BOOST_QUEUE
#define BOOST_THREAD_USES_BOOST_QUEUE
#endif
#include <boost/container/queue.hpp>
#else
#include <queue> #include <queue>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_QUEUE
using ::boost::container::queue;
#else
using ::std::queue; using ::std::queue;
#endif
} }
} }
#endif // header #endif // header
#endif

View File

@@ -9,28 +9,12 @@
#ifndef BOOST_CSBL_TUPLE_HPP #ifndef BOOST_CSBL_TUPLE_HPP
#define BOOST_CSBL_TUPLE_HPP #define BOOST_CSBL_TUPLE_HPP
#include <boost/config.hpp>
#if defined BOOST_THREAD_USES_BOOST_TUPLE || defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/tuple/tuple.hpp>
#ifndef BOOST_THREAD_USES_BOOST_TUPLE
#define BOOST_THREAD_USES_BOOST_TUPLE
#endif
#else
#include <tuple> #include <tuple>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_TUPLE
using ::boost::tuple;
using ::boost::get;
using ::boost::make_tuple;
//using ::boost::tuple_size;
#else
// 20.4.2, class template tuple: // 20.4.2, class template tuple:
using ::std::tuple; using ::std::tuple;
using ::std::get; using ::std::get;
@@ -42,8 +26,7 @@ namespace boost
// 20.4.2.7, relational operators: // 20.4.2.7, relational operators:
// 20.4.2.8, allocator-related traits // 20.4.2.8, allocator-related traits
// 20.4.2.9, specialized algorithms: // 20.4.2.9, specialized algorithms:
#endif
} }
} }
#endif // header #endif // header

View File

@@ -9,27 +9,14 @@
#ifndef BOOST_CSBL_VECTOR_HPP #ifndef BOOST_CSBL_VECTOR_HPP
#define BOOST_CSBL_VECTOR_HPP #define BOOST_CSBL_VECTOR_HPP
#include <boost/config.hpp>
#if defined BOOST_THREAD_USES_BOOST_VECTOR || defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC
#ifndef BOOST_THREAD_USES_BOOST_VECTOR
#define BOOST_THREAD_USES_BOOST_VECTOR
#endif
#include <boost/container/vector.hpp>
#else
#include <vector> #include <vector>
#endif
namespace boost namespace boost
{ {
namespace csbl namespace csbl
{ {
#if defined BOOST_THREAD_USES_BOOST_VECTOR
using ::boost::container::vector;
#else
using ::std::vector; using ::std::vector;
#endif
} }
} }
#endif // header #endif // header

View File

@@ -32,6 +32,7 @@
#include <boost/type_traits/is_base_of.hpp> #include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_pointer.hpp> #include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_member_function_pointer.hpp> #include <boost/type_traits/is_member_function_pointer.hpp>
#include <boost/type_traits/is_member_object_pointer.hpp>
#include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/remove_reference.hpp>
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
#include <functional> #include <functional>
@@ -85,7 +86,13 @@ namespace boost
// bullets 3 and 4 // bullets 3 and 4
template <class Fp, class A0> // enable_if avoids
//
// ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039
// https://sourceforge.net/p/mingw-w64/bugs/694/
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756
template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
inline auto inline auto
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
-> decltype(boost::forward<A0>(a0).*f) -> decltype(boost::forward<A0>(a0).*f)
@@ -93,7 +100,7 @@ namespace boost
return boost::forward<A0>(a0).*f; return boost::forward<A0>(a0).*f;
} }
template <class Fp, class A0> template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
inline auto inline auto
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
-> decltype((*boost::forward<A0>(a0)).*f) -> decltype((*boost::forward<A0>(a0)).*f)
@@ -101,7 +108,7 @@ namespace boost
return (*boost::forward<A0>(a0)).*f; return (*boost::forward<A0>(a0)).*f;
} }
template <class R, class Fp, class A0> template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
inline auto inline auto
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
-> decltype(boost::forward<A0>(a0).*f) -> decltype(boost::forward<A0>(a0).*f)
@@ -109,7 +116,7 @@ namespace boost
return boost::forward<A0>(a0).*f; return boost::forward<A0>(a0).*f;
} }
template <class R, class Fp, class A0> template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
inline auto inline auto
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
-> decltype((*boost::forward<A0>(a0)).*f) -> decltype((*boost::forward<A0>(a0)).*f)

View File

@@ -0,0 +1,55 @@
#ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED
#define BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED
// Copyright 2023 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <string>
#include <climits>
namespace boost
{
namespace thread_detail
{
inline bool string_to_unsigned( std::string const& s, unsigned& v )
{
v = 0;
if( s.empty() )
{
return false;
}
for( char const* p = s.c_str(); *p; ++p )
{
unsigned char ch = static_cast<unsigned char>( *p );
if( ch < '0' || ch > '9' )
{
return false;
}
if( v > UINT_MAX / 10 )
{
return false;
}
unsigned q = static_cast<unsigned>( ch - '0' );
if( v == UINT_MAX / 10 && q > UINT_MAX % 10 )
{
return false;
}
v = v * 10 + q;
}
return true;
}
} // namespace thread_detail
} // namespace boost
#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED

View File

@@ -0,0 +1,29 @@
#ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
#define BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
// Copyright 2023 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <string>
namespace boost
{
namespace thread_detail
{
inline std::string string_trim( std::string const& s )
{
std::size_t i = s.find_first_not_of( " \t\r\n" );
if( i == std::string::npos ) return std::string();
std::size_t j = s.find_last_not_of( " \t\r\n" );
return s.substr( i, j + 1 - i );
}
} // namespace thread_detail
} // namespace boost
#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED

View File

@@ -30,7 +30,6 @@
#include <algorithm> #include <algorithm>
#include <boost/core/ref.hpp> #include <boost/core/ref.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/bind/bind.hpp>
#include <stdlib.h> #include <stdlib.h>
#include <memory> #include <memory>
#include <boost/core/enable_if.hpp> #include <boost/core/enable_if.hpp>
@@ -47,6 +46,8 @@
#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
#include <tuple> #include <tuple>
#else
#include <boost/bind/bind.hpp>
#endif #endif
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>

View File

@@ -51,7 +51,7 @@ BOOST_THREAD_INLINE_NAMESPACE(v2)
namespace detail namespace detail
{ {
void handle_task_region_exceptions(exception_list& errors) inline void handle_task_region_exceptions(exception_list& errors)
{ {
try { try {
throw; throw;

View File

@@ -18,7 +18,7 @@
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/core/swap.hpp> #include <boost/core/invoke_swap.hpp>
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>
@@ -105,8 +105,8 @@ namespace boost
void swap(externally_locked& rhs) //BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR) void swap(externally_locked& rhs) //BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR)
{ {
swap(obj_, rhs.obj_); boost::core::invoke_swap(obj_, rhs.obj_);
swap(mtx_, rhs.mtx_); boost::core::invoke_swap(mtx_, rhs.mtx_);
} }
/** /**
@@ -245,8 +245,8 @@ namespace boost
void swap(externally_locked& rhs) BOOST_NOEXCEPT void swap(externally_locked& rhs) BOOST_NOEXCEPT
{ {
swap(obj_, rhs.obj_); boost::core::invoke_swap(obj_, rhs.obj_);
swap(mtx_, rhs.mtx_); boost::core::invoke_swap(mtx_, rhs.mtx_);
} }
/** /**
* Requires: The lk parameter must be locking the associated mtx. * Requires: The lk parameter must be locking the associated mtx.

View File

@@ -63,7 +63,6 @@ struct shared_state_base {
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <boost/exception_ptr.hpp> #include <boost/exception_ptr.hpp>
#include <boost/function.hpp> #include <boost/function.hpp>
#include <boost/next_prior.hpp>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared.hpp> #include <boost/smart_ptr/make_shared.hpp>
@@ -393,7 +392,7 @@ namespace boost
is_deferred_=false; is_deferred_=false;
execute(lk); execute(lk);
} }
waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this))); waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
if(rethrow && exception) if(rethrow && exception)
{ {
boost::rethrow_exception(exception); boost::rethrow_exception(exception);
@@ -420,7 +419,7 @@ namespace boost
return false; return false;
do_callback(lock); do_callback(lock);
return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, boost::ref(*this))); return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, this));
} }
bool timed_wait_until(boost::system_time const& target_time) bool timed_wait_until(boost::system_time const& target_time)
@@ -430,7 +429,7 @@ namespace boost
return false; return false;
do_callback(lock); do_callback(lock);
return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, boost::ref(*this))); return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, this));
} }
#endif #endif
#ifdef BOOST_THREAD_USES_CHRONO #ifdef BOOST_THREAD_USES_CHRONO
@@ -443,7 +442,7 @@ namespace boost
if (is_deferred_) if (is_deferred_)
return future_status::deferred; return future_status::deferred;
do_callback(lock); do_callback(lock);
if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, boost::ref(*this)))) if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, this)))
{ {
return future_status::timeout; return future_status::timeout;
} }
@@ -940,7 +939,7 @@ namespace boost
join(); join();
#elif defined BOOST_THREAD_ASYNC_FUTURE_WAITS #elif defined BOOST_THREAD_ASYNC_FUTURE_WAITS
unique_lock<boost::mutex> lk(this->mutex); unique_lock<boost::mutex> lk(this->mutex);
this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this))); this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
#endif #endif
} }
@@ -4650,32 +4649,34 @@ namespace detail
shared_ptr<FutureExecutorContinuationSharedState> that_; shared_ptr<FutureExecutorContinuationSharedState> that_;
#if ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_THREAD_COPYABLE_AND_MOVABLE(run_it) BOOST_THREAD_COPYABLE_AND_MOVABLE(run_it)
run_it(run_it const& x) //BOOST_NOEXCEPT run_it(run_it const& x) //BOOST_NOEXCEPT
: that_(x.that_) : that_(x.that_)
{} {}
run_it& operator=(BOOST_THREAD_COPY_ASSIGN_REF(run_it) x) //BOOST_NOEXCEPT run_it& operator=(BOOST_THREAD_COPY_ASSIGN_REF(run_it) x) //BOOST_NOEXCEPT
{ {
if (this != &x) { if (this != &x) {
that_=x.that_; that_=x.that_;
}
return *this;
} }
// move return *this;
run_it(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT }
: that_(x.that_) // move
{ run_it(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT
x.that_.reset(); : that_(boost::move(x.that_))
} {
run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT { }
if (this != &x) { run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT {
that_=x.that; if (this != &x) {
x.that_.reset(); that_ = boost::move(x.that_);
}
return *this;
} }
return *this;
}
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_(boost::move(that))
{}
#else
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_(that)
{}
#endif #endif
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_ (that) {}
void operator()() void operator()()
{ {

View File

@@ -17,7 +17,6 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/core/enable_if.hpp> #include <boost/core/enable_if.hpp>
#include <boost/next_prior.hpp>
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
#include <iterator> #include <iterator>
@@ -155,7 +154,9 @@ namespace boost
{ {
waiter.add(*current); waiter.add(*current);
} }
return boost::next(begin, waiter.wait());
std::advance( begin, waiter.wait() );
return begin;
} }
} }

View File

@@ -19,14 +19,17 @@
#include <boost/thread/detail/delete.hpp> #include <boost/thread/detail/delete.hpp>
#include <boost/core/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
#include <boost/bind/bind.hpp>
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config/abi_prefix.hpp>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <pthread.h> #include <pthread.h>
#include <csignal> #include <csignal>
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
#include <boost/bind/bind.hpp>
#endif
#include <boost/config/abi_prefix.hpp>
namespace boost namespace boost
{ {

View File

@@ -16,8 +16,12 @@
#include <boost/thread/detail/move.hpp> #include <boost/thread/detail/move.hpp>
#include <boost/thread/detail/invoke.hpp> #include <boost/thread/detail/invoke.hpp>
#include <boost/core/no_exceptions_support.hpp> #include <boost/core/no_exceptions_support.hpp>
#include <boost/atomic/capabilities.hpp>
#include <boost/atomic/atomic.hpp>
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#include <boost/atomic.hpp> #endif
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>

View File

@@ -9,6 +9,7 @@
#include <boost/thread/detail/config.hpp> #include <boost/thread/detail/config.hpp>
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <pthread.h> #include <pthread.h>
#include <errno.h> #include <errno.h>

View File

@@ -171,7 +171,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, boost::ref(state))); shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, &state));
state.lock_shared(); state.lock_shared();
} }
@@ -194,7 +194,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, boost::ref(state)))) if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, &state)))
{ {
return false; return false;
} }
@@ -209,7 +209,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, boost::ref(state)))) if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, &state)))
{ {
return false; return false;
} }
@@ -230,7 +230,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, boost::ref(state)))) if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, &state)))
{ {
return false; return false;
} }
@@ -270,7 +270,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true; state.exclusive_waiting_blocked=true;
exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, boost::ref(state))); exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, &state));
state.exclusive=true; state.exclusive=true;
} }
@@ -282,7 +282,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true; state.exclusive_waiting_blocked=true;
if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, boost::ref(state)))) if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, &state)))
{ {
state.exclusive_waiting_blocked=false; state.exclusive_waiting_blocked=false;
release_waiters(); release_waiters();
@@ -300,7 +300,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true; state.exclusive_waiting_blocked=true;
if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, boost::ref(state)))) if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, &state)))
{ {
state.exclusive_waiting_blocked=false; state.exclusive_waiting_blocked=false;
release_waiters(); release_waiters();
@@ -324,7 +324,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.exclusive_waiting_blocked=true; state.exclusive_waiting_blocked=true;
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, boost::ref(state)))) if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, &state)))
{ {
state.exclusive_waiting_blocked=false; state.exclusive_waiting_blocked=false;
release_waiters(); release_waiters();
@@ -362,7 +362,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))); shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, &state));
state.lock_shared(); state.lock_shared();
state.upgrade=true; state.upgrade=true;
} }
@@ -374,7 +374,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)))) if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, &state)))
{ {
return false; return false;
} }
@@ -390,7 +390,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)))) if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{ {
return false; return false;
} }
@@ -412,7 +412,7 @@ namespace boost
boost::this_thread::disable_interruption do_not_disturb; boost::this_thread::disable_interruption do_not_disturb;
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)))) if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{ {
return false; return false;
} }
@@ -457,7 +457,7 @@ namespace boost
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_upgraded(); state.assert_lock_upgraded();
state.unlock_shared(); state.unlock_shared();
upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, boost::ref(state))); upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, &state));
state.upgrade=false; state.upgrade=false;
state.exclusive=true; state.exclusive=true;
state.assert_locked(); state.assert_locked();
@@ -511,7 +511,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_upgraded(); state.assert_lock_upgraded();
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state)))) if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
{ {
return false; return false;
} }
@@ -569,7 +569,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_shared(); state.assert_lock_shared();
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state)))) if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
{ {
return false; return false;
} }
@@ -623,7 +623,7 @@ namespace boost
#endif #endif
boost::unique_lock<boost::mutex> lk(state_change); boost::unique_lock<boost::mutex> lk(state_change);
state.assert_lock_shared(); state.assert_lock_shared();
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)))) if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
{ {
return false; return false;
} }

View File

@@ -14,6 +14,7 @@
#include <boost/thread/detail/move.hpp> #include <boost/thread/detail/move.hpp>
#include <boost/thread/thread_functors.hpp> #include <boost/thread/thread_functors.hpp>
#include <boost/thread/thread_only.hpp> #include <boost/thread/thread_only.hpp>
#include <boost/thread/detail/thread_interruption.hpp>
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>
@@ -85,6 +86,10 @@ namespace boost
*/ */
~strict_scoped_thread() ~strict_scoped_thread()
{ {
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
// exceptions from a destructor call std::terminate
boost::this_thread::disable_interruption do_not_disturb;
#endif
CallableThread on_destructor; CallableThread on_destructor;
on_destructor(t_); on_destructor(t_);
@@ -188,6 +193,10 @@ namespace boost
*/ */
~scoped_thread() ~scoped_thread()
{ {
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
// exceptions from a destructor call std::terminate
boost::this_thread::disable_interruption do_not_disturb;
#endif
CallableThread on_destructor; CallableThread on_destructor;
on_destructor(t_); on_destructor(t_);

View File

@@ -17,8 +17,8 @@
#include <boost/thread/lock_algorithms.hpp> #include <boost/thread/lock_algorithms.hpp>
#include <boost/thread/lock_factories.hpp> #include <boost/thread/lock_factories.hpp>
#include <boost/thread/strict_lock.hpp> #include <boost/thread/strict_lock.hpp>
#include <boost/core/swap.hpp> #include <boost/core/invoke_swap.hpp>
#include <boost/utility/declval.hpp> #include <boost/type_traits/declval.hpp>
//#include <boost/type_traits.hpp> //#include <boost/type_traits.hpp>
//#include <boost/thread/detail/is_nothrow_default_constructible.hpp> //#include <boost/thread/detail/is_nothrow_default_constructible.hpp>
//#if ! defined BOOST_NO_CXX11_HDR_TYPE_TRAITS //#if ! defined BOOST_NO_CXX11_HDR_TYPE_TRAITS
@@ -582,7 +582,7 @@ namespace boost
unique_lock<mutex_type> lk1(mtx_, defer_lock); unique_lock<mutex_type> lk1(mtx_, defer_lock);
unique_lock<mutex_type> lk2(rhs.mtx_, defer_lock); unique_lock<mutex_type> lk2(rhs.mtx_, defer_lock);
lock(lk1,lk2); lock(lk1,lk2);
boost::swap(value_, rhs.value_); boost::core::invoke_swap(value_, rhs.value_);
} }
/** /**
* Swap with the underlying value type * Swap with the underlying value type
@@ -592,7 +592,7 @@ namespace boost
void swap(value_type & rhs) void swap(value_type & rhs)
{ {
strict_lock<mutex_type> lk(mtx_); strict_lock<mutex_type> lk(mtx_);
boost::swap(value_, rhs); boost::core::invoke_swap(value_, rhs);
} }
/** /**

View File

@@ -12,6 +12,7 @@
#include <boost/thread/detail/delete.hpp> #include <boost/thread/detail/delete.hpp>
#include <boost/thread/detail/move.hpp> #include <boost/thread/detail/move.hpp>
#include <boost/thread/thread_functors.hpp> #include <boost/thread/thread_functors.hpp>
#include <boost/thread/detail/thread_interruption.hpp>
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>
@@ -34,6 +35,10 @@ namespace boost
} }
~thread_guard() ~thread_guard()
{ {
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
// exceptions from a destructor call std::terminate
boost::this_thread::disable_interruption do_not_disturb;
#endif
CallableThread on_destructor; CallableThread on_destructor;
on_destructor(t_); on_destructor(t_);

View File

@@ -275,9 +275,9 @@ namespace boost {
inline void shared_mutex::lock() inline void shared_mutex::lock()
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer, boost::ref(*this))); gate1_.wait(lk, boost::bind(&shared_mutex::no_writer, this));
state_ |= write_entered_; state_ |= write_entered_;
gate2_.wait(lk, boost::bind(&shared_mutex::no_readers, boost::ref(*this))); gate2_.wait(lk, boost::bind(&shared_mutex::no_readers, this));
} }
inline bool shared_mutex::try_lock() inline bool shared_mutex::try_lock()
@@ -298,13 +298,13 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&shared_mutex::no_writer, boost::ref(*this)))) &shared_mutex::no_writer, this)))
{ {
return false; return false;
} }
state_ |= write_entered_; state_ |= write_entered_;
if (!gate2_.wait_until(lk, abs_time, boost::bind( if (!gate2_.wait_until(lk, abs_time, boost::bind(
&shared_mutex::no_readers, boost::ref(*this)))) &shared_mutex::no_readers, this)))
{ {
state_ &= ~write_entered_; state_ &= ~write_entered_;
return false; return false;
@@ -319,13 +319,13 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
&shared_mutex::no_writer, boost::ref(*this)))) &shared_mutex::no_writer, this)))
{ {
return false; return false;
} }
state_ |= write_entered_; state_ |= write_entered_;
if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind(
&shared_mutex::no_readers, boost::ref(*this)))) &shared_mutex::no_readers, this)))
{ {
state_ &= ~write_entered_; state_ &= ~write_entered_;
return false; return false;
@@ -350,7 +350,7 @@ namespace boost {
inline void shared_mutex::lock_shared() inline void shared_mutex::lock_shared()
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer_no_max_readers, boost::ref(*this))); gate1_.wait(lk, boost::bind(&shared_mutex::no_writer_no_max_readers, this));
count_t num_readers = (state_ & n_readers_) + 1; count_t num_readers = (state_ & n_readers_) + 1;
state_ &= ~n_readers_; state_ &= ~n_readers_;
state_ |= num_readers; state_ |= num_readers;
@@ -376,7 +376,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&shared_mutex::no_writer_no_max_readers, boost::ref(*this)))) &shared_mutex::no_writer_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -393,7 +393,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
&shared_mutex::no_writer_no_max_readers, boost::ref(*this)))) &shared_mutex::no_writer_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -653,9 +653,9 @@ namespace boost {
inline void upgrade_mutex::lock() inline void upgrade_mutex::lock()
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this))); gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader, this));
state_ |= write_entered_; state_ |= write_entered_;
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, boost::ref(*this))); gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, this));
} }
inline bool upgrade_mutex::try_lock() inline bool upgrade_mutex::try_lock()
@@ -676,13 +676,13 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader, this)))
{ {
return false; return false;
} }
state_ |= write_entered_; state_ |= write_entered_;
if (!gate2_.wait_until(lk, abs_time, boost::bind( if (!gate2_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_readers, boost::ref(*this)))) &upgrade_mutex::no_readers, this)))
{ {
state_ &= ~write_entered_; state_ &= ~write_entered_;
return false; return false;
@@ -697,13 +697,13 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader, this)))
{ {
return false; return false;
} }
state_ |= write_entered_; state_ |= write_entered_;
if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind(
&upgrade_mutex::no_readers, boost::ref(*this)))) &upgrade_mutex::no_readers, this)))
{ {
state_ &= ~write_entered_; state_ &= ~write_entered_;
return false; return false;
@@ -729,7 +729,7 @@ namespace boost {
inline void upgrade_mutex::lock_shared() inline void upgrade_mutex::lock_shared()
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this))); gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_max_readers, this));
count_t num_readers = (state_ & n_readers_) + 1; count_t num_readers = (state_ & n_readers_) + 1;
state_ &= ~n_readers_; state_ &= ~n_readers_;
state_ |= num_readers; state_ |= num_readers;
@@ -755,7 +755,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this)))) &upgrade_mutex::no_writer_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -772,7 +772,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this)))) &upgrade_mutex::no_writer_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -807,7 +807,7 @@ namespace boost {
inline void upgrade_mutex::lock_upgrade() inline void upgrade_mutex::lock_upgrade()
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this))); gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader_no_max_readers, this));
count_t num_readers = (state_ & n_readers_) + 1; count_t num_readers = (state_ & n_readers_) + 1;
state_ &= ~n_readers_; state_ &= ~n_readers_;
state_ |= upgradable_entered_ | num_readers; state_ |= upgradable_entered_ | num_readers;
@@ -833,7 +833,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -850,7 +850,7 @@ namespace boost {
{ {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind( if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader_no_max_readers, this)))
{ {
return false; return false;
} }
@@ -898,7 +898,7 @@ namespace boost {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
BOOST_ASSERT(one_or_more_readers()); BOOST_ASSERT(one_or_more_readers());
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader, this)))
{ {
return false; return false;
} }
@@ -906,7 +906,7 @@ namespace boost {
state_ &= ~n_readers_; state_ &= ~n_readers_;
state_ |= (write_entered_ | num_readers); state_ |= (write_entered_ | num_readers);
if (!gate2_.wait_until(lk, abs_time, boost::bind( if (!gate2_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_readers, boost::ref(*this)))) &upgrade_mutex::no_readers, this)))
{ {
++num_readers; ++num_readers;
state_ &= ~(write_entered_ | n_readers_); state_ &= ~(write_entered_ | n_readers_);
@@ -953,7 +953,7 @@ namespace boost {
boost::unique_lock<mutex_t> lk(mut_); boost::unique_lock<mutex_t> lk(mut_);
BOOST_ASSERT(one_or_more_readers()); BOOST_ASSERT(one_or_more_readers());
if (!gate1_.wait_until(lk, abs_time, boost::bind( if (!gate1_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this)))) &upgrade_mutex::no_writer_no_upgrader, this)))
{ {
return false; return false;
} }
@@ -987,7 +987,7 @@ namespace boost {
count_t num_readers = (state_ & n_readers_) - 1; count_t num_readers = (state_ & n_readers_) - 1;
state_ &= ~(upgradable_entered_ | n_readers_); state_ &= ~(upgradable_entered_ | n_readers_);
state_ |= write_entered_ | num_readers; state_ |= write_entered_ | num_readers;
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, boost::ref(*this))); gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, this));
} }
inline bool upgrade_mutex::try_unlock_upgrade_and_lock() inline bool upgrade_mutex::try_unlock_upgrade_and_lock()
@@ -1017,7 +1017,7 @@ namespace boost {
state_ &= ~(upgradable_entered_ | n_readers_); state_ &= ~(upgradable_entered_ | n_readers_);
state_ |= (write_entered_ | num_readers); state_ |= (write_entered_ | num_readers);
if (!gate2_.wait_until(lk, abs_time, boost::bind( if (!gate2_.wait_until(lk, abs_time, boost::bind(
&upgrade_mutex::no_readers, boost::ref(*this)))) &upgrade_mutex::no_readers, this)))
{ {
++num_readers; ++num_readers;
state_ &= ~(write_entered_ | n_readers_); state_ &= ~(write_entered_ | n_readers_);

View File

@@ -30,7 +30,7 @@ namespace boost
{ {
namespace detail namespace detail
{ {
struct basic_timed_mutex struct BOOST_THREAD_CAPABILITY("mutex") basic_timed_mutex
{ {
BOOST_STATIC_CONSTANT(unsigned char,lock_flag_bit=31); BOOST_STATIC_CONSTANT(unsigned char,lock_flag_bit=31);
BOOST_STATIC_CONSTANT(unsigned char,event_set_flag_bit=30); BOOST_STATIC_CONSTANT(unsigned char,event_set_flag_bit=30);
@@ -62,12 +62,12 @@ namespace boost
} }
// Take the lock flag if it's available // Take the lock flag if it's available
bool try_lock() BOOST_NOEXCEPT bool try_lock() BOOST_NOEXCEPT BOOST_THREAD_TRY_ACQUIRE(true)
{ {
return !win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit); return !win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit);
} }
void lock() void lock() BOOST_THREAD_ACQUIRE()
{ {
if(try_lock()) if(try_lock())
{ {
@@ -93,7 +93,7 @@ namespace boost
// Loop until the number of waiters has been incremented or we've taken the lock flag // Loop until the number of waiters has been incremented or we've taken the lock flag
// The loop is necessary since this function may be called by multiple threads simultaneously // The loop is necessary since this function may be called by multiple threads simultaneously
void mark_waiting_and_try_lock(long& old_count) void mark_waiting_and_try_lock(long& old_count) BOOST_THREAD_TRY_ACQUIRE(true)
{ {
for(;;) for(;;)
{ {
@@ -117,7 +117,7 @@ namespace boost
// until we've taken the lock flag and cleared the event set flag and decremented the // until we've taken the lock flag and cleared the event set flag and decremented the
// number of waiters // number of waiters
// The loop is necessary since this function may be called by multiple threads simultaneously // The loop is necessary since this function may be called by multiple threads simultaneously
void clear_waiting_and_try_lock(long& old_count) void clear_waiting_and_try_lock(long& old_count) BOOST_THREAD_TRY_ACQUIRE(true)
{ {
old_count&=~lock_flag_value; old_count&=~lock_flag_value;
old_count|=event_set_flag_value; old_count|=event_set_flag_value;
@@ -152,7 +152,7 @@ namespace boost
} }
template <typename Clock, typename Timepoint, typename Duration> template <typename Clock, typename Timepoint, typename Duration>
bool do_lock_until(Timepoint const& t, Duration const& max) bool do_lock_until(Timepoint const& t, Duration const& max) BOOST_THREAD_TRY_ACQUIRE(true)
{ {
if(try_lock()) if(try_lock())
{ {
@@ -238,7 +238,7 @@ namespace boost
} }
#endif #endif
void unlock() void unlock() BOOST_THREAD_RELEASE()
{ {
// Clear the lock flag using atomic addition (works since long is always 32 bits on Windows) // Clear the lock flag using atomic addition (works since long is always 32 bits on Windows)
long const old_count=BOOST_INTERLOCKED_EXCHANGE_ADD(&active_count,lock_flag_value); long const old_count=BOOST_INTERLOCKED_EXCHANGE_ADD(&active_count,lock_flag_value);

View File

@@ -22,7 +22,9 @@
#include <boost/thread/detail/move.hpp> #include <boost/thread/detail/move.hpp>
#include <boost/thread/detail/invoke.hpp> #include <boost/thread/detail/invoke.hpp>
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#endif
#include <boost/config/abi_prefix.hpp> #include <boost/config/abi_prefix.hpp>
@@ -152,7 +154,7 @@ namespace boost
{ {
name_once_mutex(mutex_name,flag_address); name_once_mutex(mutex_name,flag_address);
} }
return ::boost::detail::win32::create_event( return ::boost::detail::win32::create_event(
mutex_name, mutex_name,
::boost::detail::win32::manual_reset_event, ::boost::detail::win32::manual_reset_event,

View File

@@ -10,10 +10,11 @@
"Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr>" "Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr>"
], ],
"description": "description":
"Portable C++ multi-threading. C++03, C++11, C++14, C++17.", "Portable C++ multi-threading. C++11, C++14, C++17.",
"std": [ "proposal" ], "std": [ "proposal" ],
"category": [ "category": [
"Concurrent", "System" "Concurrent", "System"
] ],
"cxxstd": "11"
} }
] ]

View File

@@ -11,8 +11,8 @@
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp> #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/atomic.hpp>
#include <boost/memory_order.hpp> #include <boost/memory_order.hpp>
#include <boost/atomic/atomic.hpp>
#include <pthread.h> #include <pthread.h>
namespace boost namespace boost

View File

@@ -19,6 +19,8 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/pthread/pthread_helpers.hpp> #include <boost/thread/pthread/pthread_helpers.hpp>
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp> #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
#include <boost/thread/detail/string_trim.hpp>
#include <boost/thread/detail/string_to_unsigned.hpp>
#ifdef __GLIBC__ #ifdef __GLIBC__
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
@@ -33,10 +35,6 @@
#include <vxCpuLib.h> #include <vxCpuLib.h>
#endif #endif
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/lexical_cast.hpp>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <set> #include <set>
@@ -535,24 +533,36 @@ namespace boost
if (line.empty()) if (line.empty())
continue; continue;
vector<string> key_val(2); std::size_t i = line.find( ':' );
boost::split(key_val, line, boost::is_any_of(":"));
if (key_val.size() != 2) if( i == std::string::npos )
return hardware_concurrency(); {
return hardware_concurrency();
}
string key = key_val[0]; std::string key = line.substr( 0, i );
string value = key_val[1]; std::string value = line.substr( i+1 );
boost::trim(key);
boost::trim(value); key = thread_detail::string_trim( key );
value = thread_detail::string_trim( value );
if (key == physical_id) { if (key == physical_id) {
current_core_entry.first = boost::lexical_cast<unsigned>(value);
if( !thread_detail::string_to_unsigned( value, current_core_entry.first ) )
{
return hardware_concurrency();
}
continue; continue;
} }
if (key == core_id) { if (key == core_id) {
current_core_entry.second = boost::lexical_cast<unsigned>(value);
if( !thread_detail::string_to_unsigned( value, current_core_entry.second ) )
{
return hardware_concurrency();
}
cores.insert(current_core_entry); cores.insert(current_core_entry);
continue; continue;
} }

View File

@@ -34,10 +34,10 @@
#include <mutex> #include <mutex>
#include <atomic> #include <atomic>
#include <Activation.h> #include <Activation.h>
#include <wrl\client.h> #include <wrl/client.h>
#include <wrl\event.h> #include <wrl/event.h>
#include <wrl\wrappers\corewrappers.h> #include <wrl/wrappers/corewrappers.h>
#include <wrl\ftm.h> #include <wrl/ftm.h>
#include <windows.system.threading.h> #include <windows.system.threading.h>
#pragma comment(lib, "runtimeobject.lib") #pragma comment(lib, "runtimeobject.lib")
#endif #endif
@@ -577,10 +577,18 @@ namespace boost
} Reason; } Reason;
} REASON_CONTEXT, *PREASON_CONTEXT; } REASON_CONTEXT, *PREASON_CONTEXT;
typedef BOOL (WINAPI *setwaitabletimerex_t)(HANDLE, const LARGE_INTEGER *, LONG, PTIMERAPCROUTINE, LPVOID, PREASON_CONTEXT, ULONG); typedef BOOL (WINAPI *setwaitabletimerex_t)(HANDLE, const LARGE_INTEGER *, LONG, PTIMERAPCROUTINE, LPVOID, PREASON_CONTEXT, ULONG);
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4100) // unreferenced formal parameter
#endif
static inline BOOL WINAPI SetWaitableTimerEx_emulation(HANDLE hTimer, const LARGE_INTEGER *lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, ULONG TolerableDelay) static inline BOOL WINAPI SetWaitableTimerEx_emulation(HANDLE hTimer, const LARGE_INTEGER *lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, ULONG TolerableDelay)
{ {
return SetWaitableTimer(hTimer, lpDueTime, lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, FALSE); return SetWaitableTimer(hTimer, lpDueTime, lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, FALSE);
} }
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable: 6387) // MSVC sanitiser warns that GetModuleHandleA() might fail #pragma warning(disable: 6387) // MSVC sanitiser warns that GetModuleHandleA() might fail

View File

@@ -52,7 +52,7 @@ struct get_tick_count64_state
BOOST_ALIGNMENT(64) static get_tick_count64_state g_state; BOOST_ALIGNMENT(64) static get_tick_count64_state g_state;
//! Artifical implementation of GetTickCount64 //! Artifical implementation of GetTickCount64
ticks_type WINAPI get_tick_count64() ticks_type BOOST_WINAPI_WINAPI_CC get_tick_count64()
{ {
uint64_t old_state = g_state.ticks.load(boost::memory_order_acquire); uint64_t old_state = g_state.ticks.load(boost::memory_order_acquire);
@@ -67,7 +67,7 @@ ticks_type WINAPI get_tick_count64()
} }
//! The function is called periodically in the system thread pool to make sure g_state.ticks is timely updated //! The function is called periodically in the system thread pool to make sure g_state.ticks is timely updated
void NTAPI refresh_get_tick_count64(boost::winapi::PVOID_, boost::winapi::BOOLEAN_) void BOOST_WINAPI_NTAPI_CC refresh_get_tick_count64(boost::winapi::PVOID_, boost::winapi::BOOLEAN_)
{ {
get_tick_count64(); get_tick_count64();
} }
@@ -88,7 +88,7 @@ void cleanup_get_tick_count64()
} }
} }
ticks_type WINAPI get_tick_count_init() ticks_type BOOST_WINAPI_WINAPI_CC get_tick_count_init()
{ {
boost::winapi::HMODULE_ hKernel32 = boost::winapi::GetModuleHandleW(L"kernel32.dll"); boost::winapi::HMODULE_ hKernel32 = boost::winapi::GetModuleHandleW(L"kernel32.dll");
if (hKernel32) if (hKernel32)

View File

@@ -268,16 +268,15 @@ rule generate_self_contained_header_tests
if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ] if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
{ {
local headers_path = [ path.make $(BOOST_ROOT)/libs/thread/include/boost/thread ] ; for file in [ glob-tree-ex ../include/boost/thread : *.hpp : detail pthread win32 ]
for file in [ path.glob-tree $(headers_path) : *.hpp : detail pthread win32 ]
{ {
local rel_file = [ path.relative-to $(headers_path) $(file) ] ; local rel_file = [ path.relative-to ../include/boost/thread $(file) ] ;
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ; local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
#ECHO $(rel_file) ; #ECHO $(rel_file) ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ; all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) <use>../build//boost_thread : $(test_name) ] ;
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific : $(test_name)-post_winh ] ; all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific <use>../build//boost_thread : $(test_name)-post_winh ] ;
} }
} }
@@ -368,6 +367,10 @@ rule generate_self_contained_header_tests
[ thread-run test_10964.cpp ] [ thread-run test_10964.cpp ]
[ thread-test test_11053.cpp ] [ thread-test test_11053.cpp ]
[ thread-run test_11266.cpp ] [ thread-run test_11266.cpp ]
[ thread-run test_366_1.cpp ]
[ thread-run test_366_2.cpp ]
[ thread-run test_366_3.cpp ]
[ thread-run test_366_4.cpp ]
; ;
@@ -1008,7 +1011,7 @@ rule generate_self_contained_header_tests
#[ thread-run test_10128.cpp ] #[ thread-run test_10128.cpp ]
#[ thread-run test_10340.cpp ] #[ thread-run test_10340.cpp ]
; ;
explicit ts_more_cpp11 ; explicit ts_more_cpp11 ;
test-suite ts_more_cpp11 test-suite ts_more_cpp11
: :
@@ -1029,13 +1032,13 @@ rule generate_self_contained_header_tests
: :
[ thread-run2-noit ./experimental/parallel/v1/exception_list_pass.cpp : exception_list_p ] [ thread-run2-noit ./experimental/parallel/v1/exception_list_pass.cpp : exception_list_p ]
; ;
#explicit ts_task_region ; #explicit ts_task_region ;
test-suite ts_task_region test-suite ts_task_region
: :
[ thread-run2-noit ./experimental/parallel/v2/task_region_pass.cpp : task_region_p ] [ thread-run2-noit ./experimental/parallel/v2/task_region_pass.cpp : task_region_p ]
; ;
explicit ts_other ; explicit ts_other ;
test-suite ts_other test-suite ts_other
: :
@@ -1046,7 +1049,7 @@ rule generate_self_contained_header_tests
explicit ts_ ; explicit ts_ ;
test-suite ts_ test-suite ts_
: :
#[ thread-run test_11256.cpp ] #[ thread-run test_11256.cpp ]
#[ thread-run test_11256.cpp ] #[ thread-run test_11256.cpp ]
#[ thread-run test_11499.cpp ] #[ thread-run test_11499.cpp ]
#[ thread-run test_11611.cpp ] #[ thread-run test_11611.cpp ]
@@ -1056,7 +1059,7 @@ rule generate_self_contained_header_tests
#[ thread-run test_12949.cpp ] #[ thread-run test_12949.cpp ]
#[ thread-run test_13480b.cpp ] #[ thread-run test_13480b.cpp ]
[ thread-run test_13561.cpp ] [ thread-run test_13561.cpp ]
; ;
explicit test_time_jumps_1_obj ; explicit test_time_jumps_1_obj ;
@@ -1095,4 +1098,10 @@ rule generate_self_contained_header_tests
; ;
test-suite test_self_contained_headers : [ generate_self_contained_header_tests ] ; test-suite test_self_contained_headers : [ generate_self_contained_header_tests ] ;
test-suite detail
:
[ run detail/string_trim_test.cpp ]
[ run detail/string_to_unsigned_test.cpp ]
;
} }

View File

@@ -0,0 +1,55 @@
// Copyright 2023 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/thread/detail/string_to_unsigned.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
using boost::thread_detail::string_to_unsigned;
unsigned v;
BOOST_TEST_NOT( string_to_unsigned( "", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST_NOT( string_to_unsigned( " ", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST_NOT( string_to_unsigned( "+1", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST_NOT( string_to_unsigned( "-1", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST_NOT( string_to_unsigned( "abc", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST( string_to_unsigned( "0", v ) ) && BOOST_TEST_EQ( v, 0 );
BOOST_TEST( string_to_unsigned( "1", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "12", v ) ) && BOOST_TEST_EQ( v, 12 );
BOOST_TEST( string_to_unsigned( "123", v ) ) && BOOST_TEST_EQ( v, 123 );
BOOST_TEST( string_to_unsigned( "1234", v ) ) && BOOST_TEST_EQ( v, 1234 );
BOOST_TEST( string_to_unsigned( "12345", v ) ) && BOOST_TEST_EQ( v, 12345 );
BOOST_TEST( string_to_unsigned( "123456", v ) ) && BOOST_TEST_EQ( v, 123456 );
BOOST_TEST( string_to_unsigned( "1234567", v ) ) && BOOST_TEST_EQ( v, 1234567 );
BOOST_TEST( string_to_unsigned( "12345678", v ) ) && BOOST_TEST_EQ( v, 12345678 );
BOOST_TEST( string_to_unsigned( "123456789", v ) ) && BOOST_TEST_EQ( v, 123456789 );
BOOST_TEST( string_to_unsigned( "1234567890", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
BOOST_TEST_NOT( string_to_unsigned( "12345678901", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
BOOST_TEST_NOT( string_to_unsigned( "123456789012", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
BOOST_TEST( string_to_unsigned( "4294967295", v ) ) && BOOST_TEST_EQ( v, 4294967295 );
BOOST_TEST_NOT( string_to_unsigned( "4294967296", v ) ) && BOOST_TEST_EQ( v, 429496729 );
BOOST_TEST( string_to_unsigned( "01", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "0001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "00001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "0000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "00000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "0000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "00000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "0000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST( string_to_unsigned( "00000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST_NOT( string_to_unsigned( "1a", v ) ) && BOOST_TEST_EQ( v, 1 );
BOOST_TEST_NOT( string_to_unsigned( "2 ", v ) ) && BOOST_TEST_EQ( v, 2 );
return boost::report_errors();
}

View File

@@ -0,0 +1,48 @@
// Copyright 2023 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/thread/detail/string_trim.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
using boost::thread_detail::string_trim;
BOOST_TEST_EQ( string_trim( "" ), std::string( "" ) );
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
BOOST_TEST_EQ( string_trim( " \t\r\n \t\r\n" ), std::string( "" ) );
BOOST_TEST_EQ( string_trim( "a" ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
BOOST_TEST_EQ( string_trim( "a b" ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
return boost::report_errors();
}

View File

@@ -14,7 +14,7 @@
#include <boost/thread/experimental/parallel/v1/exception_list.hpp> #include <boost/thread/experimental/parallel/v1/exception_list.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()

View File

@@ -16,7 +16,7 @@
#include <boost/thread/experimental/parallel/v2/task_region.hpp> #include <boost/thread/experimental/parallel/v2/task_region.hpp>
#include <string> #include <string>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if ! defined BOOST_NO_CXX11_LAMBDAS && defined(BOOST_THREAD_PROVIDES_INVOKE) #if ! defined BOOST_NO_CXX11_LAMBDAS && defined(BOOST_THREAD_PROVIDES_INVOKE)
using boost::experimental::parallel::v2::task_region; using boost::experimental::parallel::v2::task_region;

View File

@@ -15,7 +15,7 @@
// <boost/thread/detail/invoke.hpp> // <boost/thread/detail/invoke.hpp>
#include <boost/thread/detail/invoke.hpp> #include <boost/thread/detail/invoke.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int f() int f()
{ {

View File

@@ -16,7 +16,7 @@
// <boost/thread/detail/invoke.hpp> // <boost/thread/detail/invoke.hpp>
#include <boost/thread/detail/invoke.hpp> #include <boost/thread/detail/invoke.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int count = 0; int count = 0;

View File

@@ -15,7 +15,7 @@
// <boost/thread/detail/invoke.hpp> // <boost/thread/detail/invoke.hpp>
#include <boost/thread/detail/invoke.hpp> #include <boost/thread/detail/invoke.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int count = 0; int count = 0;

View File

@@ -15,7 +15,7 @@
// <boost/thread/detail/invoker.hpp> // <boost/thread/detail/invoker.hpp>
#include <boost/thread/detail/invoker.hpp> #include <boost/thread/detail/invoker.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int f() int f()
{ {

View File

@@ -15,7 +15,7 @@
// <boost/thread/detail/invoker.hpp> // <boost/thread/detail/invoker.hpp>
#include <boost/thread/detail/invoker.hpp> #include <boost/thread/detail/invoker.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int count = 0; int count = 0;

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <boost/thread/detail/invoker.hpp> #include <boost/thread/detail/invoker.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int count = 0; int count = 0;

View File

@@ -18,7 +18,7 @@
// condition_variable(const condition_variable&) = delete; // condition_variable(const condition_variable&) = delete;
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
void fail() void fail()
{ {

View File

@@ -18,7 +18,7 @@
// condition_variable(const condition_variable&) = delete; // condition_variable(const condition_variable&) = delete;
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -21,7 +21,7 @@
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/thread/locks.hpp> #include <boost/thread/locks.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
boost::condition_variable* cv; boost::condition_variable* cv;
boost::mutex m; boost::mutex m;

View File

@@ -21,7 +21,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
// Summary of each test: // Summary of each test:

View File

@@ -20,7 +20,8 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -21,7 +21,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
#include "../../../timming.hpp" #include "../../../timming.hpp"

View File

@@ -20,7 +20,8 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include "../../../timming.hpp" #include "../../../timming.hpp"
@@ -64,9 +65,9 @@ void f()
assert(test2 == 0); assert(test2 == 0);
test1 = 1; test1 = 1;
cv.notify_one(); cv.notify_one();
Clock::time_point t0 = Clock::now(); BOOST_ATTRIBUTE_UNUSED Clock::time_point t0 = Clock::now();
cv.wait_for(lk, milliseconds(250), Pred(test2)); cv.wait_for(lk, milliseconds(250), Pred(test2));
Clock::time_point t1 = Clock::now(); BOOST_ATTRIBUTE_UNUSED Clock::time_point t1 = Clock::now();
if (runs == 0) if (runs == 0)
{ {
assert(t1 - t0 < max_diff); assert(t1 - t0 < max_diff);

View File

@@ -21,7 +21,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>

View File

@@ -20,7 +20,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <iostream> #include <iostream>
#include <cassert> #include <cassert>
#include "../../../timming.hpp" #include "../../../timming.hpp"

View File

@@ -20,7 +20,8 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include "../../../timming.hpp" #include "../../../timming.hpp"
@@ -79,7 +80,7 @@ void f()
cv.notify_one(); cv.notify_one();
Clock::time_point t0 = Clock::now(); Clock::time_point t0 = Clock::now();
Clock::time_point t = t0 + Clock::duration(250); Clock::time_point t = t0 + Clock::duration(250);
bool r = cv.wait_until(lk, t, Pred(test2)); BOOST_ATTRIBUTE_UNUSED bool r = cv.wait_until(lk, t, Pred(test2));
Clock::time_point t1 = Clock::now(); Clock::time_point t1 = Clock::now();
if (runs == 0) if (runs == 0)
{ {

View File

@@ -18,7 +18,7 @@
// condition_variable_any(const condition_variable_any&) = delete; // condition_variable_any(const condition_variable_any&) = delete;
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
void fail() void fail()
{ {

View File

@@ -18,7 +18,7 @@
// condition_variable_any(const condition_variable_any&) = delete; // condition_variable_any(const condition_variable_any&) = delete;
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -21,7 +21,7 @@
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/thread/locks.hpp> #include <boost/thread/locks.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
boost::condition_variable_any* cv; boost::condition_variable_any* cv;
boost::timed_mutex m; boost::timed_mutex m;

View File

@@ -21,7 +21,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
// Summary of each test: // Summary of each test:

View File

@@ -20,7 +20,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include "../../../timming.hpp" #include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -20,7 +20,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include "../../../timming.hpp" #include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -20,7 +20,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include "../../../timming.hpp" #include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -20,7 +20,7 @@
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include "../../../timming.hpp" #include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -18,7 +18,7 @@
// static unsigned hardware_concurrency(); // static unsigned hardware_concurrency();
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -23,7 +23,7 @@
#include <boost/thread/locks.hpp> #include <boost/thread/locks.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/chrono/chrono.hpp> #include <boost/chrono/chrono.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
boost::condition_variable cv; boost::condition_variable cv;
boost::mutex mut; boost::mutex mut;

View File

@@ -29,7 +29,7 @@
#include <boost/thread/detail/memory.hpp> #include <boost/thread/detail/memory.hpp>
#include <boost/thread/csbl/memory/unique_ptr.hpp> #include <boost/thread/csbl/memory/unique_ptr.hpp>
#include <memory> #include <memory>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp> #include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/executor.hpp> #include <boost/thread/executor.hpp>

View File

@@ -34,7 +34,7 @@
#include <boost/thread/detail/memory.hpp> #include <boost/thread/detail/memory.hpp>
#include <boost/thread/csbl/memory/unique_ptr.hpp> #include <boost/thread/csbl/memory/unique_ptr.hpp>
#include <memory> #include <memory>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
typedef boost::chrono::high_resolution_clock Clock; typedef boost::chrono::high_resolution_clock Clock;
typedef boost::chrono::milliseconds ms; typedef boost::chrono::milliseconds ms;

View File

@@ -16,7 +16,7 @@
#include <boost/thread/detail/log.hpp> #include <boost/thread/detail/log.hpp>
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)

View File

@@ -21,7 +21,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -20,7 +20,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -21,7 +21,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -22,7 +22,7 @@
#include <boost/exception/exception.hpp> #include <boost/exception/exception.hpp>
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
#include "../test_allocator.hpp" #include "../test_allocator.hpp"
#endif #endif

View File

@@ -18,7 +18,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/core/ref.hpp> #include <boost/core/ref.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -28,7 +28,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -21,7 +21,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
boost::mutex m0; boost::mutex m0;
boost::mutex m1; boost::mutex m1;

View File

@@ -21,7 +21,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
boost::mutex m; boost::mutex m;

View File

@@ -21,7 +21,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
int main() int main()
{ {

View File

@@ -16,7 +16,7 @@
#include <boost/thread/detail/log.hpp> #include <boost/thread/detail/log.hpp>
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION

View File

@@ -18,7 +18,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp> #include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/executor.hpp> #include <boost/thread/executor.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <cassert> #include <cassert>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION

View File

@@ -16,7 +16,7 @@
#include <boost/thread/detail/log.hpp> #include <boost/thread/detail/log.hpp>
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION

View File

@@ -29,7 +29,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/chrono/chrono_io.hpp> #include <boost/chrono/chrono_io.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -28,7 +28,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/chrono/chrono_io.hpp> #include <boost/chrono/chrono_io.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -29,7 +29,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/chrono/chrono_io.hpp> #include <boost/chrono/chrono_io.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include "../../../timming.hpp" #include "../../../timming.hpp"
#if defined BOOST_THREAD_USES_CHRONO #if defined BOOST_THREAD_USES_CHRONO

View File

@@ -29,7 +29,7 @@
#define BOOST_THREAD_VERSION 3 #define BOOST_THREAD_VERSION 3
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
struct A struct A

View File

@@ -29,7 +29,7 @@
#include <boost/thread/detail/config.hpp> #include <boost/thread/detail/config.hpp>
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS

View File

@@ -26,7 +26,7 @@
#endif #endif
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/core/lightweight_test.hpp>
class A class A
{ {

Some files were not shown because too many files have changed in this diff Show More