mirror of
https://github.com/boostorg/thread.git
synced 2026-02-03 09:42:16 +00:00
Compare commits
76 Commits
boost-1.72
...
feature/ap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0264d6813 | ||
|
|
cf06d84362 | ||
|
|
ccc5e3142c | ||
|
|
97060416f1 | ||
|
|
88e32fd1ac | ||
|
|
5f41e68838 | ||
|
|
7d570f70d8 | ||
|
|
e62d29f917 | ||
|
|
09f01fbb05 | ||
|
|
fadb514c71 | ||
|
|
30dcb6dcbc | ||
|
|
27cb703930 | ||
|
|
d56f3f25ad | ||
|
|
52b62ee7b0 | ||
|
|
78af23ca14 | ||
|
|
743d19d7d3 | ||
|
|
7f7faf234d | ||
|
|
1de55fceda | ||
|
|
8db325363b | ||
|
|
f71e0f1645 | ||
|
|
7f36ea346f | ||
|
|
660f293809 | ||
|
|
d4b81d83f7 | ||
|
|
e4d16eb4d9 | ||
|
|
28a0a19cf0 | ||
|
|
fca97a8826 | ||
|
|
48e639b124 | ||
|
|
51f3e163b3 | ||
|
|
6fca28bfed | ||
|
|
636e4a869c | ||
|
|
f9d0e594d4 | ||
|
|
23e7658347 | ||
|
|
190ec21523 | ||
|
|
f17d23ac2a | ||
|
|
4abafccff4 | ||
|
|
c55e0952ee | ||
|
|
409c98f8b7 | ||
|
|
573296557a | ||
|
|
4bc126fc37 | ||
|
|
96cd717b33 | ||
|
|
7afa3e9fd4 | ||
|
|
f5bf0951be | ||
|
|
1fceaebe00 | ||
|
|
30f0ec41fe | ||
|
|
49ece352b3 | ||
|
|
116e8f6eb8 | ||
|
|
66892e5ddd | ||
|
|
42a48f4b03 | ||
|
|
f33abfd621 | ||
|
|
0277d357ae | ||
|
|
e18ae7b173 | ||
|
|
119009f2d1 | ||
|
|
9eee38db94 | ||
|
|
3e59ecec49 | ||
|
|
b1842da010 | ||
|
|
b0da8e291b | ||
|
|
1d436f9030 | ||
|
|
8ebd61c280 | ||
|
|
c13beec81c | ||
|
|
1c28a63e26 | ||
|
|
9b0e0714f0 | ||
|
|
a2492a49af | ||
|
|
25ea5c83ed | ||
|
|
1623ca9e05 | ||
|
|
b1d20a5ce7 | ||
|
|
5f9a247e0b | ||
|
|
9efc377980 | ||
|
|
5589c69547 | ||
|
|
74fb0a2609 | ||
|
|
1eb8efbad7 | ||
|
|
76ce71930f | ||
|
|
2e0bae88f7 | ||
|
|
5507e47ac2 | ||
|
|
2492e7a48c | ||
|
|
0ee9ad87eb | ||
|
|
47fd6b85e3 |
105
.github/workflows/ci.yml
vendored
Normal file
105
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- feature/**
|
||||
|
||||
env:
|
||||
UBSAN_OPTIONS: print_stacktrace=1
|
||||
|
||||
jobs:
|
||||
posix:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- toolset: gcc-4.8
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:18.04
|
||||
cxxstd: 11
|
||||
install: g++-4.8
|
||||
- toolset: gcc-5
|
||||
cxxstd: 11
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:18.04
|
||||
install: g++-5
|
||||
- toolset: gcc-7
|
||||
os: ubuntu-20.04
|
||||
install: g++-7
|
||||
- toolset: gcc-9
|
||||
os: ubuntu-20.04
|
||||
- toolset: gcc-11
|
||||
os: ubuntu-22.04
|
||||
- toolset: clang
|
||||
compiler: clang++-15
|
||||
cxxstd: 20
|
||||
os: ubuntu-22.04
|
||||
install: clang-15
|
||||
- toolset: clang
|
||||
os: macos-11
|
||||
cxxstd: 11
|
||||
- toolset: clang
|
||||
os: macos-12
|
||||
cxxstd: 14
|
||||
- toolset: clang
|
||||
os: macos-13
|
||||
cxxstd: 17
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
container: ${{matrix.container}}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup container environment
|
||||
if: matrix.container
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get -y install sudo python3 git g++
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
||||
LIBRARY=${GITHUB_REPOSITORY#*/}
|
||||
echo LIBRARY: $LIBRARY
|
||||
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
||||
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
||||
echo GITHUB_REF: $GITHUB_REF
|
||||
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||
REF=${REF#refs/heads/}
|
||||
echo REF: $REF
|
||||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||
cd ..
|
||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||
git submodule update --init tools/boostdep
|
||||
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
- name: Create user-config.jam
|
||||
if: matrix.compiler
|
||||
run: |
|
||||
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd ../boost-root
|
||||
export CXXSTD=${{matrix.cxxstd}}
|
||||
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} ${CXXSTD:+cxxstd=$CXXSTD} variant=debug,release
|
||||
444
.travis.yml
444
.travis.yml
@@ -4,13 +4,7 @@
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
os: linux
|
||||
|
||||
branches:
|
||||
only:
|
||||
@@ -29,123 +23,88 @@ matrix:
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++11 SELF_CONTAINED_HEADER_TESTS=1
|
||||
|
||||
# - os: linux
|
||||
# compiler: g++-4.7
|
||||
# env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-4.7
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-4.8
|
||||
# env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-4.8
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-4.9
|
||||
# env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-4.9
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-5
|
||||
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++98
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-5
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-5
|
||||
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-5
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-5
|
||||
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-5
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-5
|
||||
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++1z
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-5
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-6
|
||||
# env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++98
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-6
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-6
|
||||
# env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-6
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-6
|
||||
# env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-6
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: g++-6
|
||||
# env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - g++-6
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
compiler: g++-4.4
|
||||
env: TOOLSET=gcc CXXSTD=98,0x HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.4
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.6
|
||||
env: TOOLSET=gcc CXXSTD=98,0x HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.7
|
||||
env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.8
|
||||
env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.9
|
||||
env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc CXXSTD=03
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-6
|
||||
env: TOOLSET=gcc CXXSTD=14,1z HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++98
|
||||
env: TOOLSET=gcc CXXSTD=14,17 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
@@ -154,196 +113,177 @@ matrix:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++11
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc CXXSTD=14,17 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: TOOLSET=gcc CXXSTD=14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: TOOLSET=gcc CXXSTD=17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++14
|
||||
compiler: clang++-3.5
|
||||
env: TOOLSET=clang CXXSTD=03,11 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
- clang-3.5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++1z
|
||||
compiler: clang++-3.6
|
||||
env: TOOLSET=clang CXXSTD=03,11,14 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang CXXSTD=03,11,14 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang CXXSTD=03,11,14 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang CXXSTD=03,11,14,1z HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
# - os: linux
|
||||
# compiler: clang++-3.5
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.5
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.5#
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.6
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.6
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.6
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.7
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.7
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.7
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.8
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.8
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.8
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.8
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.8
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.8
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.8
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.8
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.8
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.9
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.9
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.9
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.9
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.9
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.9
|
||||
#
|
||||
# - os: linux
|
||||
# compiler: clang++-3.9
|
||||
# env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z
|
||||
# addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - clang-3.9
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# - llvm-toolchain-precise-3.9
|
||||
#
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++98
|
||||
env: TOOLSET=clang CXXSTD=03,11,14,1z HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++11
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang CXXSTD=03,11,14,1z HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++14
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang CXXSTD=14,17 HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++1z
|
||||
compiler: clang++-7
|
||||
env: TOOLSET=clang CXXSTD=14,17,2a HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
- clang-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
- llvm-toolchain-xenial-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: TOOLSET=clang CXXSTD=14,17,2a HEADERS_ONLY=1
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-9
|
||||
env: TOOLSET=clang CXXSTD=14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-9
|
||||
env: TOOLSET=clang CXXSTD=17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++98 SELF_CONTAINED_HEADER_TESTS=1
|
||||
env: TOOLSET=clang CXXSTD=98
|
||||
|
||||
# - os: osx
|
||||
# compiler: clang++
|
||||
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11
|
||||
# env: TOOLSET=clang CXXSTD=11
|
||||
|
||||
# - os: osx
|
||||
# compiler: clang++
|
||||
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14
|
||||
# env: TOOLSET=clang CXXSTD=14
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z
|
||||
env: TOOLSET=clang CXXSTD=1z
|
||||
|
||||
install:
|
||||
- GIT_FETCH_JOBS=8
|
||||
@@ -364,10 +304,8 @@ install:
|
||||
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam
|
||||
- BUILD_JOBS=`(nproc || sysctl -n hw.ncpu) 2> /dev/null`
|
||||
- if [ -z "$SELF_CONTAINED_HEADER_TESTS" ]; then export BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1; fi
|
||||
- ./b2 -j $BUILD_JOBS -l60 libs/thread/test toolset=$TOOLSET
|
||||
echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 -j3 -l60 libs/thread/test${HEADERS_ONLY:+//test_self_contained_headers} toolset=$TOOLSET cxxstd=$CXXSTD
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
||||
105
CMakeLists.txt
Normal file
105
CMakeLists.txt
Normal file
@@ -0,0 +1,105 @@
|
||||
# Generated by `boostdep --cmake thread`
|
||||
# Copyright 2020 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(_default_threadapi pthread)
|
||||
|
||||
if(WIN32 AND NOT CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin")
|
||||
set(_default_threadapi win32)
|
||||
endif()
|
||||
|
||||
set(BOOST_THREAD_THREADAPI ${_default_threadapi} CACHE STRING "Boost.Thread threading API (pthread or win32)")
|
||||
set_property(CACHE BOOST_THREAD_THREADAPI PROPERTY STRINGS pthread win32)
|
||||
|
||||
unset(_default_threadapi)
|
||||
|
||||
message(STATUS "Boost.Thread: threading API is ${BOOST_THREAD_THREADAPI}")
|
||||
|
||||
if(BOOST_THREAD_THREADAPI STREQUAL win32)
|
||||
|
||||
set(THREAD_SOURCES
|
||||
src/win32/thread.cpp
|
||||
src/win32/tss_dll.cpp
|
||||
src/win32/tss_pe.cpp
|
||||
src/win32/thread_primitives.cpp
|
||||
src/future.cpp
|
||||
)
|
||||
|
||||
else()
|
||||
|
||||
set(THREAD_SOURCES
|
||||
src/pthread/thread.cpp
|
||||
src/pthread/once.cpp
|
||||
src/future.cpp
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
add_library(boost_thread ${THREAD_SOURCES})
|
||||
|
||||
add_library(Boost::thread ALIAS boost_thread)
|
||||
|
||||
target_include_directories(boost_thread PUBLIC include)
|
||||
|
||||
target_link_libraries(boost_thread
|
||||
PUBLIC
|
||||
Boost::assert
|
||||
Boost::atomic
|
||||
Boost::bind
|
||||
Boost::chrono
|
||||
Boost::concept_check
|
||||
Boost::config
|
||||
Boost::container
|
||||
Boost::container_hash
|
||||
Boost::core
|
||||
Boost::date_time
|
||||
Boost::exception
|
||||
Boost::function
|
||||
Boost::intrusive
|
||||
Boost::io
|
||||
Boost::iterator
|
||||
Boost::move
|
||||
Boost::optional
|
||||
Boost::predef
|
||||
Boost::preprocessor
|
||||
Boost::smart_ptr
|
||||
Boost::static_assert
|
||||
Boost::system
|
||||
Boost::throw_exception
|
||||
Boost::tuple
|
||||
Boost::type_traits
|
||||
Boost::utility
|
||||
Boost::winapi
|
||||
|
||||
Threads::Threads
|
||||
|
||||
PRIVATE
|
||||
Boost::algorithm
|
||||
Boost::lexical_cast
|
||||
)
|
||||
|
||||
target_compile_definitions(boost_thread
|
||||
PUBLIC BOOST_THREAD_NO_LIB
|
||||
PRIVATE BOOST_THREAD_SOURCE
|
||||
)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(boost_thread PUBLIC BOOST_THREAD_DYN_LINK INTERFACE BOOST_THREAD_USE_DLL PRIVATE BOOST_THREAD_BUILD_DLL)
|
||||
else()
|
||||
target_compile_definitions(boost_thread PUBLIC BOOST_THREAD_STATIC_LINK INTERFACE BOOST_THREAD_USE_LIB PRIVATE BOOST_THREAD_BUILD_LIB)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||
|
||||
add_subdirectory(test)
|
||||
|
||||
endif()
|
||||
|
||||
77
appveyor.yml
77
appveyor.yml
@@ -13,39 +13,56 @@ branches:
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
image: Visual Studio 2015
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
# TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
|
||||
TOOLSET: msvc-12.0
|
||||
SELF_CONTAINED_HEADER_TESTS: 1
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-14.0
|
||||
|
||||
- TOOLSET: msvc-14.0
|
||||
ADDRMD: 32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
CXXSTD: 17
|
||||
VARIANT: debug
|
||||
|
||||
- TOOLSET: msvc-14.1
|
||||
ADDRMD: 64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
VARIANT: release
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
|
||||
- TOOLSET: msvc-14.2
|
||||
CXXSTD: 17
|
||||
ADDRMD: 32
|
||||
VARIANT: debug
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
|
||||
- TOOLSET: msvc-14.2
|
||||
ADDRMD: 64
|
||||
VARIANT: release
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
|
||||
- ADDPATH: C:\cygwin\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 14
|
||||
SELF_CONTAINED_HEADER_TESTS: 1
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 14
|
||||
SELF_CONTAINED_HEADER_TESTS: 1
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 14
|
||||
SELF_CONTAINED_HEADER_TESTS: 1
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 14
|
||||
SELF_CONTAINED_HEADER_TESTS: 1
|
||||
VARIANT: release
|
||||
|
||||
# The following configurations fail with
|
||||
# ./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
|
||||
#
|
||||
# - ADDPATH: C:\mingw\bin;
|
||||
# TOOLSET: gcc
|
||||
# CXXSTD: 11
|
||||
# VARIANT: debug
|
||||
#
|
||||
# - ADDPATH: C:\cygwin64\bin;
|
||||
# TOOLSET: gcc
|
||||
# VARIANT: debug
|
||||
#
|
||||
# - 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:
|
||||
- set GIT_FETCH_JOBS=8
|
||||
@@ -67,7 +84,7 @@ build: off
|
||||
|
||||
test_script:
|
||||
- PATH=%ADDPATH%%PATH%
|
||||
- if "%SELF_CONTAINED_HEADER_TESTS%" == "" set BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1
|
||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||
- b2 -j %NUMBER_OF_PROCESSORS% libs/thread/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release
|
||||
- if not "%VARIANT%" == "" set VARIANT=variant=%VARIANT%
|
||||
- b2 -j2 --abbreviate-paths libs/thread/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% %VARIANT%
|
||||
|
||||
@@ -303,7 +303,7 @@ When `BOOST_THREAD_VERSION>=4` define `BOOST_THREAD_DONT_PROVIDE_SIGNATURE_PACKA
|
||||
|
||||
[section:thread_const-var thread constructor with variadic rvalue parameters]
|
||||
|
||||
C++11 thread constructor accep a variable number of rvalue argumentshas. When `BOOST_THREAD_PROVIDES_VARIADIC_THREAD ` is defined Boost.Thread provides this C++ feature if the following are not defined
|
||||
C++11 thread constructor accept a variable number of rvalue arguments has. When `BOOST_THREAD_PROVIDES_VARIADIC_THREAD ` is defined Boost.Thread provides this C++ feature if the following are not defined
|
||||
|
||||
* BOOST_NO_SFINAE_EXPR
|
||||
* BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
|
||||
@@ -20,6 +20,7 @@ struct func
|
||||
int& i;
|
||||
|
||||
func(int& i_):i(i_){}
|
||||
func(func const& other):i(other.i){}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace detail
|
||||
template <class Q, class T,
|
||||
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#if defined __GNUC__ && ! defined __clang__
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
bool Copyable = is_copy_constructible<T>::value,
|
||||
bool Movable = true
|
||||
#else
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace detail
|
||||
template <class T, class ST,
|
||||
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#if defined __GNUC__ && ! defined __clang__
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
bool Copyable = is_copy_constructible<T>::value,
|
||||
bool Movable = true
|
||||
#else
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace detail
|
||||
template <class Q, class T,
|
||||
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#if defined __GNUC__ && ! defined __clang__
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
bool Copyable = is_copy_constructible<T>::value,
|
||||
bool Movable = true
|
||||
#else
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace detail
|
||||
template <class T, class ST,
|
||||
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#if defined __GNUC__ && ! defined __clang__
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
bool Copyable = is_copy_constructible<T>::value,
|
||||
bool Movable = true
|
||||
#else
|
||||
|
||||
@@ -655,7 +655,7 @@ namespace concurrent
|
||||
queue_op_status sync_bounded_queue<ValueType>::wait_push_back(BOOST_THREAD_RV_REF(ValueType) elem)
|
||||
{
|
||||
unique_lock<mutex> lk(mtx_);
|
||||
return try_push_back(boost::move(elem), lk);
|
||||
return wait_push_back(boost::move(elem), lk);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
#define BOOST_THREAD_FUTURE_USES_OPTIONAL
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
# pragma warn -8008 // Condition always true/false
|
||||
# pragma warn -8080 // Identifier declared but never used
|
||||
# pragma warn -8057 // Parameter never used
|
||||
@@ -470,7 +470,8 @@
|
||||
#else //Use default
|
||||
# if defined(BOOST_THREAD_PLATFORM_WIN32)
|
||||
# if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \
|
||||
|| defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32)
|
||||
|| defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32) \
|
||||
|| (defined(_MSC_VER) && defined(__clang__))
|
||||
//For compilers supporting auto-tss cleanup
|
||||
//with Boost.Threads lib, use Boost.Threads lib
|
||||
# define BOOST_THREAD_USE_LIB
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
@@ -531,13 +530,13 @@ namespace boost
|
||||
// f(t1, t2, ..., tN) in all other cases.
|
||||
|
||||
template <class Ret, class Fp, class ...Args>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(Args) ...args)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(Args) ...args)
|
||||
{
|
||||
return boost::forward<Fp>(f)(boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class ...Args>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(Args) ...args)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(Args) ...args)
|
||||
{
|
||||
return f(boost::forward<Args>(args)...);
|
||||
}
|
||||
@@ -1360,12 +1359,12 @@ namespace boost
|
||||
// f(t1, t2, ..., tN) in all other cases.
|
||||
|
||||
template <class Ret, class Fp>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f)
|
||||
{
|
||||
return boost::forward<Fp>(f)();
|
||||
}
|
||||
template <class Ret, class Fp>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f)
|
||||
{
|
||||
return f();
|
||||
}
|
||||
@@ -1382,12 +1381,12 @@ namespace boost
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class A1>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1)
|
||||
{
|
||||
return boost::forward<Fp>(f)(boost::forward<A1>(a1));
|
||||
}
|
||||
template <class Ret, class Fp, class A1>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1)
|
||||
{
|
||||
return f(boost::forward<A1>(a1));
|
||||
}
|
||||
@@ -1404,12 +1403,12 @@ namespace boost
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class A1, class A2>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2)
|
||||
{
|
||||
return boost::forward<Fp>(f)(boost::forward<A1>(a1), boost::forward<A2>(a2));
|
||||
}
|
||||
template <class Ret, class Fp, class A1, class A2>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2)
|
||||
{
|
||||
return f(boost::forward<A1>(a1), boost::forward<A2>(a2));
|
||||
}
|
||||
@@ -1426,12 +1425,12 @@ namespace boost
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class A1, class A2, class A3>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2, BOOST_THREAD_RV_REF(A3) a3)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2, BOOST_THREAD_RV_REF(A3) a3)
|
||||
{
|
||||
return boost::forward<Fp>(f)(boost::forward<A1>(a1), boost::forward<A2>(a2), boost::forward<A3>(a3));
|
||||
}
|
||||
template <class Ret, class Fp, class A1, class A2, class A3>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2, BOOST_THREAD_RV_REF(A3) a3)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, BOOST_THREAD_RV_REF(A1) a1, BOOST_THREAD_RV_REF(A2) a2, BOOST_THREAD_RV_REF(A3) a3)
|
||||
{
|
||||
return f(boost::forward<A1>(a1), boost::forward<A2>(a2), boost::forward<A3>(a3));
|
||||
}
|
||||
@@ -1449,12 +1448,12 @@ namespace boost
|
||||
|
||||
|
||||
template <class Ret, class Fp, class A1>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1)
|
||||
{
|
||||
return boost::forward<Fp>(f)(a1);
|
||||
}
|
||||
template <class Ret, class Fp, class A1>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1)
|
||||
{
|
||||
return f(a1);
|
||||
}
|
||||
@@ -1471,12 +1470,12 @@ namespace boost
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class A1, class A2>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2)
|
||||
{
|
||||
return boost::forward<Fp>(f)(a1, a2);
|
||||
}
|
||||
template <class Ret, class Fp, class A1, class A2>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2)
|
||||
{
|
||||
return f(a1, a2);
|
||||
}
|
||||
@@ -1493,12 +1492,12 @@ namespace boost
|
||||
}
|
||||
|
||||
template <class Ret, class Fp, class A1, class A2, class A3>
|
||||
inline Ret do_invoke(mpl::false_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2, A3 a3)
|
||||
inline Ret do_invoke(boost::false_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2, A3 a3)
|
||||
{
|
||||
return boost::forward<Fp>(f)(a1, a2, a3);
|
||||
}
|
||||
template <class Ret, class Fp, class A1, class A2, class A3>
|
||||
inline Ret do_invoke(mpl::true_, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2, A3 a3)
|
||||
inline Ret do_invoke(boost::true_type, BOOST_THREAD_FWD_REF(Fp) f, A1 a1, A2 a2, A3 a3)
|
||||
{
|
||||
return f(a1, a2, a3);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
|
||||
#include <boost/detail/winapi/time.hpp>
|
||||
#include <boost/detail/winapi/timers.hpp>
|
||||
#include <boost/winapi/time.hpp>
|
||||
#include <boost/winapi/timers.hpp>
|
||||
#include <boost/thread/win32/thread_primitives.hpp>
|
||||
#elif defined(BOOST_THREAD_CHRONO_MAC_API)
|
||||
#include <sys/time.h> //for gettimeofday and timeval
|
||||
@@ -293,8 +293,8 @@ inline FP init_steady_clock(kern_return_t & err)
|
||||
static real_platform_timepoint now()
|
||||
{
|
||||
#if defined(BOOST_THREAD_CHRONO_WINDOWS_API)
|
||||
boost::detail::winapi::FILETIME_ ft;
|
||||
boost::detail::winapi::GetSystemTimeAsFileTime(&ft); // never fails
|
||||
boost::winapi::FILETIME_ ft;
|
||||
boost::winapi::GetSystemTimeAsFileTime(&ft); // never fails
|
||||
boost::time_max_t ns = ((((static_cast<boost::time_max_t>(ft.dwHighDateTime) << 32) | ft.dwLowDateTime) - 116444736000000000LL) * 100LL);
|
||||
return real_platform_timepoint(ns);
|
||||
#elif defined(BOOST_THREAD_CHRONO_MAC_API)
|
||||
@@ -401,8 +401,8 @@ inline FP init_steady_clock(kern_return_t & err)
|
||||
// Use QueryPerformanceCounter() to match the implementation in Boost
|
||||
// Chrono so that chrono::steady_clock::now() and this function share the
|
||||
// same epoch and so can be converted between each other.
|
||||
boost::detail::winapi::LARGE_INTEGER_ freq;
|
||||
if ( !boost::detail::winapi::QueryPerformanceFrequency( &freq ) )
|
||||
boost::winapi::LARGE_INTEGER_ freq;
|
||||
if ( !boost::winapi::QueryPerformanceFrequency( &freq ) )
|
||||
{
|
||||
BOOST_ASSERT(0 && "Boost::Thread - QueryPerformanceFrequency Internal Error");
|
||||
return mono_platform_timepoint(0);
|
||||
@@ -413,9 +413,9 @@ inline FP init_steady_clock(kern_return_t & err)
|
||||
return mono_platform_timepoint(0);
|
||||
}
|
||||
|
||||
boost::detail::winapi::LARGE_INTEGER_ pcount;
|
||||
boost::winapi::LARGE_INTEGER_ pcount;
|
||||
unsigned times=0;
|
||||
while ( ! boost::detail::winapi::QueryPerformanceCounter( &pcount ) )
|
||||
while ( ! boost::winapi::QueryPerformanceCounter( &pcount ) )
|
||||
{
|
||||
if ( ++times > 3 )
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <algorithm>
|
||||
#include <boost/core/ref.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
@@ -601,6 +601,9 @@ namespace boost
|
||||
class BOOST_SYMBOL_VISIBLE thread::id
|
||||
{
|
||||
private:
|
||||
|
||||
#if !defined(BOOST_EMBTC)
|
||||
|
||||
friend inline
|
||||
std::size_t
|
||||
hash_value(const thread::id &v)
|
||||
@@ -612,6 +615,14 @@ namespace boost
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
friend
|
||||
std::size_t
|
||||
hash_value(const thread::id &v);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
|
||||
#if defined(BOOST_THREAD_PLATFORM_WIN32)
|
||||
typedef unsigned int data;
|
||||
@@ -637,10 +648,6 @@ namespace boost
|
||||
#endif
|
||||
{}
|
||||
|
||||
id(const id& other) BOOST_NOEXCEPT :
|
||||
thread_data(other.thread_data)
|
||||
{}
|
||||
|
||||
bool operator==(const id& y) const BOOST_NOEXCEPT
|
||||
{
|
||||
return thread_data==y.thread_data;
|
||||
@@ -708,6 +715,21 @@ namespace boost
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_EMBTC)
|
||||
|
||||
inline
|
||||
std::size_t
|
||||
hash_value(const thread::id &v)
|
||||
{
|
||||
#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
|
||||
return hash_value(v.thread_data);
|
||||
#else
|
||||
return hash_value(v.thread_data.get());
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_THREAD_PLATFORM_PTHREAD
|
||||
inline thread::id thread::get_id() const BOOST_NOEXCEPT
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/core/swap.hpp>
|
||||
#include <boost/core/invoke_swap.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
@@ -105,8 +105,8 @@ namespace boost
|
||||
|
||||
void swap(externally_locked& rhs) //BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR)
|
||||
{
|
||||
swap(obj_, rhs.obj_);
|
||||
swap(mtx_, rhs.mtx_);
|
||||
boost::core::invoke_swap(obj_, rhs.obj_);
|
||||
boost::core::invoke_swap(mtx_, rhs.mtx_);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,8 +245,8 @@ namespace boost
|
||||
|
||||
void swap(externally_locked& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
swap(obj_, rhs.obj_);
|
||||
swap(mtx_, rhs.mtx_);
|
||||
boost::core::invoke_swap(obj_, rhs.obj_);
|
||||
boost::core::invoke_swap(mtx_, rhs.mtx_);
|
||||
}
|
||||
/**
|
||||
* Requires: The lk parameter must be locking the associated mtx.
|
||||
|
||||
@@ -54,7 +54,7 @@ struct shared_state_base {
|
||||
#endif
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#ifdef BOOST_THREAD_USES_CHRONO
|
||||
#include <boost/chrono/system_clocks.hpp>
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <boost/thread/detail/delete.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/atomic.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace boost
|
||||
#else
|
||||
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
|
||||
#endif
|
||||
#if PTHREAD_STACK_MIN > 0
|
||||
if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
|
||||
#ifdef PTHREAD_STACK_MIN
|
||||
if (size<static_cast<std::size_t>(PTHREAD_STACK_MIN)) size=PTHREAD_STACK_MIN;
|
||||
#endif
|
||||
size = ((size+page_size-1)/page_size)*page_size;
|
||||
int res = pthread_attr_setstacksize(&val_, size);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/thread_functors.hpp>
|
||||
#include <boost/thread/thread_only.hpp>
|
||||
#include <boost/thread/detail/thread_interruption.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
@@ -85,6 +86,10 @@ namespace boost
|
||||
*/
|
||||
~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;
|
||||
|
||||
on_destructor(t_);
|
||||
@@ -188,6 +193,10 @@ namespace boost
|
||||
*/
|
||||
~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;
|
||||
|
||||
on_destructor(t_);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
#include <boost/thread/lock_algorithms.hpp>
|
||||
#include <boost/thread/lock_factories.hpp>
|
||||
#include <boost/thread/strict_lock.hpp>
|
||||
#include <boost/core/swap.hpp>
|
||||
#include <boost/utility/declval.hpp>
|
||||
#include <boost/core/invoke_swap.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
//#include <boost/type_traits.hpp>
|
||||
//#include <boost/thread/detail/is_nothrow_default_constructible.hpp>
|
||||
//#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> lk2(rhs.mtx_, defer_lock);
|
||||
lock(lk1,lk2);
|
||||
boost::swap(value_, rhs.value_);
|
||||
boost::core::invoke_swap(value_, rhs.value_);
|
||||
}
|
||||
/**
|
||||
* Swap with the underlying value type
|
||||
@@ -592,7 +592,7 @@ namespace boost
|
||||
void swap(value_type & rhs)
|
||||
{
|
||||
strict_lock<mutex_type> lk(mtx_);
|
||||
boost::swap(value_, rhs);
|
||||
boost::core::invoke_swap(value_, rhs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <boost/thread/detail/delete.hpp>
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/thread_functors.hpp>
|
||||
#include <boost/thread/detail/thread_interruption.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
@@ -34,6 +35,10 @@ namespace boost
|
||||
}
|
||||
~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;
|
||||
|
||||
on_destructor(t_);
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
#endif
|
||||
#include <climits>
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace thread_v2 {
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace boost
|
||||
{
|
||||
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,event_set_flag_bit=30);
|
||||
@@ -62,12 +62,12 @@ namespace boost
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
void lock()
|
||||
void lock() BOOST_THREAD_ACQUIRE()
|
||||
{
|
||||
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
|
||||
// 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(;;)
|
||||
{
|
||||
@@ -117,7 +117,7 @@ namespace boost
|
||||
// until we've taken the lock flag and cleared the event set flag and decremented the
|
||||
// number of waiters
|
||||
// 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|=event_set_flag_value;
|
||||
@@ -152,7 +152,7 @@ namespace boost
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
@@ -238,7 +238,7 @@ namespace boost
|
||||
}
|
||||
#endif
|
||||
|
||||
void unlock()
|
||||
void unlock() BOOST_THREAD_RELEASE()
|
||||
{
|
||||
// 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);
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
// Define compiler barriers
|
||||
#if defined(__INTEL_COMPILER)
|
||||
#define BOOST_THREAD_DETAIL_COMPILER_BARRIER() __memory_barrier()
|
||||
#elif defined(__clang__)
|
||||
#define BOOST_THREAD_DETAIL_COMPILER_BARRIER() __atomic_signal_fence(__ATOMIC_SEQ_CST)
|
||||
#elif defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||
extern "C" void _ReadWriteBarrier(void);
|
||||
#pragma intrinsic(_ReadWriteBarrier)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
|
||||
@@ -145,6 +145,8 @@ namespace boost
|
||||
{}
|
||||
virtual ~thread_data_base();
|
||||
|
||||
#if !defined(BOOST_EMBTC)
|
||||
|
||||
friend void intrusive_ptr_add_ref(thread_data_base * p)
|
||||
{
|
||||
BOOST_INTERLOCKED_INCREMENT(&p->count);
|
||||
@@ -158,6 +160,13 @@ namespace boost
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
friend void intrusive_ptr_add_ref(thread_data_base * p);
|
||||
friend void intrusive_ptr_release(thread_data_base * p);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
|
||||
void interrupt()
|
||||
{
|
||||
@@ -180,6 +189,24 @@ namespace boost
|
||||
}
|
||||
//#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_EMBTC)
|
||||
|
||||
inline void intrusive_ptr_add_ref(thread_data_base * p)
|
||||
{
|
||||
BOOST_INTERLOCKED_INCREMENT(&p->count);
|
||||
}
|
||||
|
||||
inline void intrusive_ptr_release(thread_data_base * p)
|
||||
{
|
||||
if(!BOOST_INTERLOCKED_DECREMENT(&p->count))
|
||||
{
|
||||
detail::heap_delete(p);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_THREAD_DECL thread_data_base* get_current_thread_data();
|
||||
|
||||
typedef boost::intrusive_ptr<detail::thread_data_base> thread_data_ptr;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"std": [ "proposal" ],
|
||||
"category": [
|
||||
"Concurrent", "System"
|
||||
]
|
||||
],
|
||||
"cxxstd": "03"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -641,9 +641,15 @@ namespace boost
|
||||
timer_handle=CreateWaitableTimer(NULL,false,NULL);
|
||||
if(timer_handle!=0)
|
||||
{
|
||||
ULONG tolerable=32; // Empirical testing shows Windows ignores this when <= 26
|
||||
ULONG const min_tolerable=32; // Empirical testing shows Windows ignores this when <= 26
|
||||
ULONG const max_tolerable=1000;
|
||||
ULONG tolerable=min_tolerable;
|
||||
if(time_left_msec/20>tolerable) // 5%
|
||||
{
|
||||
tolerable=static_cast<ULONG>(time_left_msec/20);
|
||||
if(tolerable>max_tolerable)
|
||||
tolerable=max_tolerable;
|
||||
}
|
||||
LARGE_INTEGER due_time={{0,0}};
|
||||
if(time_left_msec>0)
|
||||
{
|
||||
@@ -733,9 +739,15 @@ namespace boost
|
||||
timer_handle=CreateWaitableTimer(NULL,false,NULL);
|
||||
if(timer_handle!=0)
|
||||
{
|
||||
ULONG tolerable=32; // Empirical testing shows Windows ignores this when <= 26
|
||||
ULONG const min_tolerable=32; // Empirical testing shows Windows ignores this when <= 26
|
||||
ULONG const max_tolerable=1000;
|
||||
ULONG tolerable=min_tolerable;
|
||||
if(time_left_msec/20>tolerable) // 5%
|
||||
{
|
||||
tolerable=static_cast<ULONG>(time_left_msec/20);
|
||||
if(tolerable>max_tolerable)
|
||||
tolerable=max_tolerable;
|
||||
}
|
||||
LARGE_INTEGER due_time={{0,0}};
|
||||
if(time_left_msec>0)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ struct get_tick_count64_state
|
||||
BOOST_ALIGNMENT(64) static get_tick_count64_state g_state;
|
||||
|
||||
//! 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);
|
||||
|
||||
@@ -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
|
||||
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();
|
||||
}
|
||||
@@ -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");
|
||||
if (hKernel32)
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#if defined(BOOST_BORLANDC)
|
||||
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
#elif defined(BOOST_EMBTC)
|
||||
extern "C" int _libmain(DWORD dwReason)
|
||||
#elif defined(_WIN32_WCE)
|
||||
extern "C" BOOL WINAPI DllMain(HANDLE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
|
||||
#else
|
||||
|
||||
@@ -152,19 +152,25 @@ extern BOOL (WINAPI * const _pDefaultRawDllMainOrig)(HINSTANCE, DWORD, LPVOID) =
|
||||
static PVAPI_V on_process_init();
|
||||
static PVAPI_V on_process_term();
|
||||
static void NTAPI on_tls_callback(HINSTANCE, DWORD, PVOID);
|
||||
}
|
||||
|
||||
namespace boost
|
||||
{
|
||||
//The .CRT$Xxx information is taken from Codeguru:
|
||||
//http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/
|
||||
|
||||
// Variables below are not referenced anywhere and
|
||||
// to not be optimized away has to have external linkage
|
||||
|
||||
#if (_MSC_VER >= 1400)
|
||||
#pragma section(".CRT$XIU",long,read)
|
||||
#pragma section(".CRT$XCU",long,read)
|
||||
#pragma section(".CRT$XTU",long,read)
|
||||
#pragma section(".CRT$XLC",long,read)
|
||||
__declspec(allocate(".CRT$XLC")) _TLSCB __xl_ca=on_tls_callback;
|
||||
__declspec(allocate(".CRT$XIU"))_PIFV_ p_tls_prepare = on_tls_prepare;
|
||||
__declspec(allocate(".CRT$XCU"))_PVFV_ p_process_init = on_process_init;
|
||||
__declspec(allocate(".CRT$XTU"))_PVFV_ p_process_term = on_process_term;
|
||||
extern const __declspec(allocate(".CRT$XLC")) _TLSCB p_tls_callback = on_tls_callback;
|
||||
extern const __declspec(allocate(".CRT$XIU")) _PIFV_ p_tls_prepare = on_tls_prepare;
|
||||
extern const __declspec(allocate(".CRT$XCU")) _PVFV_ p_process_init = on_process_init;
|
||||
extern const __declspec(allocate(".CRT$XTU")) _PVFV_ p_process_term = on_process_term;
|
||||
#else
|
||||
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
|
||||
# pragma data_seg(push, old_seg)
|
||||
@@ -176,30 +182,33 @@ extern BOOL (WINAPI * const _pDefaultRawDllMainOrig)(HINSTANCE, DWORD, LPVOID) =
|
||||
//this could be changed easily if required.
|
||||
|
||||
#pragma data_seg(".CRT$XIU")
|
||||
static _PIFV_ p_tls_prepare = on_tls_prepare;
|
||||
extern const _PIFV_ p_tls_prepare = on_tls_prepare;
|
||||
#pragma data_seg()
|
||||
|
||||
//Callback after all global ctors.
|
||||
|
||||
#pragma data_seg(".CRT$XCU")
|
||||
static _PVFV_ p_process_init = on_process_init;
|
||||
extern const _PVFV_ p_process_init = on_process_init;
|
||||
#pragma data_seg()
|
||||
|
||||
//Callback for tls notifications.
|
||||
|
||||
#pragma data_seg(".CRT$XLB")
|
||||
_TLSCB p_thread_callback = on_tls_callback;
|
||||
extern const _TLSCB p_thread_callback = on_tls_callback;
|
||||
#pragma data_seg()
|
||||
//Callback for termination.
|
||||
|
||||
#pragma data_seg(".CRT$XTU")
|
||||
static _PVFV_ p_process_term = on_process_term;
|
||||
extern const _PVFV_ p_process_term = on_process_term;
|
||||
#pragma data_seg()
|
||||
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
|
||||
# pragma data_seg(pop, old_seg)
|
||||
#endif
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
namespace
|
||||
{
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4189)
|
||||
|
||||
@@ -34,8 +34,7 @@ project
|
||||
<toolset>gcc:<cxxflags>-Wno-long-long
|
||||
#<toolset>gcc:<cxxflags>-ansi
|
||||
#<toolset>gcc:<cxxflags>-fpermissive
|
||||
<toolset>gcc-4:<cxxflags>-Wno-variadic-macros
|
||||
<toolset>gcc-5:<cxxflags>-Wno-variadic-macros
|
||||
<toolset>gcc:<cxxflags>-Wno-variadic-macros
|
||||
#<toolset>gcc:<cxxflags>-Wunused-local-typedefs
|
||||
<toolset>gcc:<cxxflags>-Wunused-function
|
||||
<toolset>gcc:<cxxflags>-Wno-unused-parameter
|
||||
@@ -62,6 +61,7 @@ project
|
||||
#<toolset>clang:<cxxflags>-fpermissive # doesn't work
|
||||
<toolset>clang:<cxxflags>-Wunused-function
|
||||
<toolset>clang:<cxxflags>-Wno-unused-parameter
|
||||
<toolset>clang:<cxxflags>-Wno-c99-extensions
|
||||
|
||||
#<toolset>gcc-mingw-4.4.0:<cxxflags>-fdiagnostics-show-option
|
||||
#<toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
|
||||
@@ -368,6 +368,10 @@ rule generate_self_contained_header_tests
|
||||
[ thread-run test_10964.cpp ]
|
||||
[ thread-test test_11053.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 ]
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
@@ -38,6 +39,10 @@ public:
|
||||
finish_mutex(finish_mutex_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
locking_thread(locking_thread const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()()
|
||||
{
|
||||
// acquire lock
|
||||
@@ -84,6 +89,10 @@ public:
|
||||
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
simple_writing_thread(simple_writing_thread const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()()
|
||||
{
|
||||
boost::unique_lock<boost::shared_mutex> lk(rwm);
|
||||
@@ -115,6 +124,10 @@ public:
|
||||
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
simple_reading_thread(simple_reading_thread const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()()
|
||||
{
|
||||
boost::shared_lock<boost::shared_mutex> lk(rwm);
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#pragma warning(disable: 4127) // conditional expression is constant
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
@@ -37,9 +35,8 @@ struct wrap
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v) {
|
||||
return copy_exception(wrap<T>(v));
|
||||
}
|
||||
boost::exception_ptr make_exception_ptr(T v) {
|
||||
return boost::copy_exception(wrap<T>(v));
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
@@ -51,7 +48,7 @@ void func1(boost::promise<int> p)
|
||||
void func2(boost::promise<int> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
@@ -66,7 +63,7 @@ void func3(boost::promise<int&> p)
|
||||
void func4(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
@@ -78,7 +75,7 @@ void func5(boost::promise<void> p)
|
||||
void func6(boost::promise<void> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(4));
|
||||
p.set_exception(::make_exception_ptr(4));
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +107,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func2, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
#endif
|
||||
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
|
||||
try
|
||||
@@ -159,7 +156,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func4, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#pragma warning(disable: 4127) // conditional expression is constant
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
@@ -47,9 +45,8 @@ struct wrap
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v) {
|
||||
return copy_exception(wrap<T>(v));
|
||||
}
|
||||
boost::exception_ptr make_exception_ptr(T v) {
|
||||
return boost::copy_exception(wrap<T>(v));
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
@@ -61,7 +58,7 @@ void func1(boost::promise<int> p)
|
||||
void func2(boost::promise<int> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
@@ -76,7 +73,7 @@ void func3(boost::promise<int&> p)
|
||||
void func4(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
@@ -88,7 +85,7 @@ void func5(boost::promise<void> p)
|
||||
void func6(boost::promise<void> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(4));
|
||||
p.set_exception(::make_exception_ptr(4));
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +117,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func2, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
#endif
|
||||
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
|
||||
try
|
||||
@@ -133,7 +130,7 @@ int main()
|
||||
BOOST_TEST(false);
|
||||
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
|
||||
}
|
||||
catch (boost::wrap<int> const& i)
|
||||
catch (::wrap<int> const& i)
|
||||
{
|
||||
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
|
||||
BOOST_TEST(i.value == 3);
|
||||
@@ -177,7 +174,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func4, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -185,7 +182,7 @@ int main()
|
||||
BOOST_TEST(f.get() == 3);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<double> const& i)
|
||||
catch (::wrap<double> const& i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3.5);
|
||||
}
|
||||
@@ -200,7 +197,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func4, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -238,7 +235,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func6, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(4));
|
||||
p.set_exception(::make_exception_ptr(4));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -246,7 +243,7 @@ int main()
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> const& i)
|
||||
catch (::wrap<int> const& i)
|
||||
{
|
||||
BOOST_TEST(i.value == 4);
|
||||
}
|
||||
|
||||
@@ -48,22 +48,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -46,22 +46,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -49,22 +49,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
@@ -38,11 +36,10 @@ namespace boost
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
boost::exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
return boost::copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
void func(boost::promise<int> p)
|
||||
@@ -51,8 +48,8 @@ boost::promise<int> p;
|
||||
void func()
|
||||
#endif
|
||||
{
|
||||
//p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception_at_thread_exit(boost::make_exception_ptr(3));
|
||||
//p.set_exception(::make_exception_ptr(3));
|
||||
p.set_exception_at_thread_exit(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -72,7 +69,7 @@ int main()
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> i)
|
||||
catch (::wrap<int> i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3);
|
||||
}
|
||||
@@ -96,7 +93,7 @@ int main()
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> i)
|
||||
catch (::wrap<int> i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
@@ -38,11 +36,10 @@ namespace boost
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
boost::exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
return boost::copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -51,19 +48,19 @@ int main()
|
||||
typedef int T;
|
||||
boost::promise<T> p;
|
||||
boost::future<T> f = p.get_future();
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
try
|
||||
{
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> i)
|
||||
catch (::wrap<int> i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3);
|
||||
}
|
||||
try
|
||||
{
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (const boost::future_error& e)
|
||||
@@ -79,7 +76,7 @@ int main()
|
||||
typedef int T;
|
||||
boost::promise<T> p;
|
||||
boost::future<T> f = p.get_future();
|
||||
p.set_exception_deferred(boost::make_exception_ptr(3));
|
||||
p.set_exception_deferred(::make_exception_ptr(3));
|
||||
BOOST_TEST(!f.is_ready());
|
||||
p.notify_deferred();
|
||||
try
|
||||
@@ -87,13 +84,13 @@ int main()
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> i)
|
||||
catch (::wrap<int> i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3);
|
||||
}
|
||||
try
|
||||
{
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (const boost::future_error& e)
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(disable: 4702) // unreachable code
|
||||
@@ -37,6 +38,9 @@ struct A
|
||||
{
|
||||
throw 10;
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
A& operator= (const A&) = default;
|
||||
#endif
|
||||
};
|
||||
|
||||
int main()
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
@@ -39,9 +37,8 @@ struct wrap
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v) {
|
||||
return copy_exception(wrap<T>(v));
|
||||
}
|
||||
boost::exception_ptr make_exception_ptr(T v) {
|
||||
return boost::copy_exception(wrap<T>(v));
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
@@ -53,7 +50,7 @@ void func1(boost::promise<int> p)
|
||||
void func2(boost::promise<int> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
@@ -68,7 +65,7 @@ void func3(boost::promise<int&> p)
|
||||
void func4(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
@@ -80,7 +77,7 @@ void func5(boost::promise<void> p)
|
||||
void func6(boost::promise<void> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
p.set_exception(boost::make_exception_ptr(4));
|
||||
p.set_exception(::make_exception_ptr(4));
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +103,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func2, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3));
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -114,7 +111,7 @@ int main()
|
||||
BOOST_TEST(f.get() == 3);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> const& i)
|
||||
catch (::wrap<int> const& i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3);
|
||||
}
|
||||
@@ -146,7 +143,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func4, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(3.5));
|
||||
p.set_exception(::make_exception_ptr(3.5));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -154,7 +151,7 @@ int main()
|
||||
BOOST_TEST(f.get() == 3);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<double> const& i)
|
||||
catch (::wrap<double> const& i)
|
||||
{
|
||||
BOOST_TEST(i.value == 3.5);
|
||||
}
|
||||
@@ -181,7 +178,7 @@ int main()
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
boost::thread(func6, boost::move(p)).detach();
|
||||
#else
|
||||
p.set_exception(boost::make_exception_ptr(4));
|
||||
p.set_exception(::make_exception_ptr(4));
|
||||
#endif
|
||||
try
|
||||
{
|
||||
@@ -189,7 +186,7 @@ int main()
|
||||
f.get();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch (boost::wrap<int> const& i)
|
||||
catch (::wrap<int> const& i)
|
||||
{
|
||||
BOOST_TEST(i.value == 4);
|
||||
}
|
||||
|
||||
@@ -48,22 +48,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -46,22 +46,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -49,22 +49,6 @@ namespace boost
|
||||
os << underlying_cast<int>(st) << " ";
|
||||
return os;
|
||||
}
|
||||
template <typename T>
|
||||
struct wrap
|
||||
{
|
||||
wrap(T const& v) :
|
||||
value(v)
|
||||
{
|
||||
}
|
||||
T value;
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
exception_ptr make_exception_ptr(T v)
|
||||
{
|
||||
return copy_exception(wrap<T> (v));
|
||||
}
|
||||
}
|
||||
|
||||
void func1(boost::promise<int> p)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/with_lock_guard.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <boost/thread/thread_only.hpp>
|
||||
#include <boost/thread/xtime.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
|
||||
|
||||
37
test/test_366_1.cpp
Normal file
37
test/test_366_1.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include "boost/thread/thread_guard.hpp"
|
||||
#include "boost/thread.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
static void inner_thread_func()
|
||||
{
|
||||
boost::this_thread::sleep_for(
|
||||
boost::chrono::hours(1) );
|
||||
}
|
||||
|
||||
static void outer_thread_func()
|
||||
{
|
||||
boost::thread inner( inner_thread_func );
|
||||
boost::thread_guard<boost::interrupt_and_join_if_joinable> guard( inner );
|
||||
}
|
||||
|
||||
static void double_interrupt()
|
||||
{
|
||||
boost::thread outer( outer_thread_func );
|
||||
boost::thread_guard<boost::interrupt_and_join_if_joinable> guard( outer );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
35
test/test_366_2.cpp
Normal file
35
test/test_366_2.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include "boost/thread/scoped_thread.hpp"
|
||||
#include "boost/thread.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
static void inner_thread_func()
|
||||
{
|
||||
boost::this_thread::sleep_for(
|
||||
boost::chrono::hours(1) );
|
||||
}
|
||||
|
||||
static void outer_thread_func()
|
||||
{
|
||||
boost::scoped_thread<boost::interrupt_and_join_if_joinable> inner( inner_thread_func );
|
||||
}
|
||||
|
||||
static void double_interrupt()
|
||||
{
|
||||
boost::scoped_thread<boost::interrupt_and_join_if_joinable> outer( outer_thread_func );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
35
test/test_366_3.cpp
Normal file
35
test/test_366_3.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include "boost/thread/scoped_thread.hpp"
|
||||
#include "boost/thread.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
static void inner_thread_func()
|
||||
{
|
||||
boost::this_thread::sleep_for(
|
||||
boost::chrono::hours(1) );
|
||||
}
|
||||
|
||||
static void outer_thread_func()
|
||||
{
|
||||
boost::strict_scoped_thread<boost::interrupt_and_join_if_joinable> inner( inner_thread_func );
|
||||
}
|
||||
|
||||
static void double_interrupt()
|
||||
{
|
||||
boost::strict_scoped_thread<boost::interrupt_and_join_if_joinable> outer( outer_thread_func );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
59
test/test_366_4.cpp
Normal file
59
test/test_366_4.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include "boost/thread/scoped_thread.hpp"
|
||||
#include "boost/thread.hpp"
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
|
||||
static void do_first_half()
|
||||
{
|
||||
std::cout << "Doing first half of the work\n";
|
||||
|
||||
boost::this_thread::sleep_for(
|
||||
boost::chrono::hours( 1 ) );
|
||||
|
||||
std::cout << "First half of the work complete\n";
|
||||
}
|
||||
|
||||
static void do_second_half()
|
||||
{
|
||||
std::cout << "Doing second half of the work\n";
|
||||
|
||||
boost::this_thread::sleep_for(
|
||||
boost::chrono::hours( 1 ) );
|
||||
|
||||
std::cout << "Second half of the work complete\n";
|
||||
}
|
||||
|
||||
static void outer_thread_func()
|
||||
{
|
||||
boost::scoped_thread<boost::interrupt_and_join_if_joinable> worker1( do_first_half );
|
||||
boost::scoped_thread<boost::interrupt_and_join_if_joinable> worker2( do_second_half );
|
||||
|
||||
worker1.join();
|
||||
worker2.join();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
|
||||
{
|
||||
boost::thread outer( outer_thread_func );
|
||||
|
||||
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
|
||||
|
||||
std::cout << "Interrupting work\n";
|
||||
|
||||
outer.interrupt();
|
||||
outer.join();
|
||||
}
|
||||
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/chrono.hpp>
|
||||
//#include <boost/bind.hpp>
|
||||
//#include <boost/bind/bind.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/future.hpp>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/chrono.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <boost/thread/thread_only.hpp>
|
||||
#include <boost/thread/xtime.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include "./util.inl"
|
||||
@@ -41,14 +42,17 @@ void condition_test_thread(condition_test_data* data)
|
||||
struct cond_predicate
|
||||
{
|
||||
cond_predicate(int& var, int val) : _var(var), _val(val) { }
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
cond_predicate(cond_predicate const&) = default;
|
||||
#endif
|
||||
|
||||
bool operator()() { return _var == _val; }
|
||||
|
||||
int& _var;
|
||||
int _val;
|
||||
|
||||
private:
|
||||
void operator=(cond_predicate&);
|
||||
|
||||
};
|
||||
|
||||
void condition_test_waits(condition_test_data* data)
|
||||
|
||||
@@ -12,7 +12,12 @@
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_physical_concurrency_is_non_zero)
|
||||
{
|
||||
#if defined(__MINGW32__) && !defined(__MINGW64__)
|
||||
// This matches the condition in win32/thread.cpp, even though
|
||||
// that's probably wrong on MinGW-w64 in 32 bit mode
|
||||
#else
|
||||
BOOST_CHECK(boost::thread::physical_concurrency()!=0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BOOST_THREAD_VERSION 4
|
||||
#define BOOST_THREAD_PROVIDES_EXECUTORS
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/chrono.hpp>
|
||||
#include <boost/chrono/chrono_io.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define BOOST_THREAD_VERSION 2
|
||||
#define BOOST_TEST_MODULE Boost.Threads: shared_mutex_part2 test suite
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/thread/xtime.hpp>
|
||||
@@ -36,6 +37,10 @@ public:
|
||||
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
simple_upgrade_thread(simple_upgrade_thread const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()()
|
||||
{
|
||||
boost::upgrade_lock<boost::shared_mutex> lk(rwm);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <boost/thread/thread_only.hpp>
|
||||
#include <boost/thread/xtime.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <boost/thread/thread_only.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
void do_nothing()
|
||||
{}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "boost/bind.hpp"
|
||||
#include "boost/bind/bind.hpp"
|
||||
#include "boost/chrono.hpp"
|
||||
#include "boost/chrono/ceil.hpp"
|
||||
#include "boost/date_time.hpp"
|
||||
|
||||
@@ -205,7 +205,10 @@ void do_test_tss()
|
||||
// Also this usually will be triggered only when bound to the static version of thread lib.
|
||||
// 2006-10-02 Roland Schwarz
|
||||
//BOOST_CHECK_EQUAL(tss_instances, 0);
|
||||
#if !defined(__MINGW32__)
|
||||
// This fails on MinGW, when using the static lib
|
||||
BOOST_CHECK_MESSAGE(tss_instances == 0, "Support of automatic tss cleanup for native threading API not available");
|
||||
#endif
|
||||
BOOST_CHECK_EQUAL(tss_total, 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ int main()
|
||||
BOOST_TEST(f_run == true);
|
||||
std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl;
|
||||
}
|
||||
#ifndef BOOST_MSVC
|
||||
#if !defined(BOOST_MSVC) && !defined(__MINGW32__)
|
||||
f_run = false;
|
||||
{
|
||||
std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl;
|
||||
|
||||
@@ -102,7 +102,7 @@ int main()
|
||||
BOOST_TEST(f_run == true);
|
||||
}
|
||||
f_run = false;
|
||||
#ifndef BOOST_MSVC
|
||||
#if !defined(BOOST_MSVC) && !defined(__MINGW32__)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -125,7 +125,7 @@ int main()
|
||||
BOOST_TEST(G::n_alive == 0);
|
||||
BOOST_TEST(G::op_run);
|
||||
}
|
||||
#ifndef BOOST_MSVC
|
||||
#if !defined(BOOST_MSVC) && !defined(__MINGW32__)
|
||||
G::op_run = false;
|
||||
{
|
||||
try
|
||||
|
||||
@@ -61,7 +61,7 @@ int main()
|
||||
t.join();
|
||||
BOOST_TEST(f_run == true);
|
||||
}
|
||||
#ifndef BOOST_MSVC
|
||||
#if !defined(BOOST_MSVC) && !defined(__MINGW32__)
|
||||
{
|
||||
f_run = false;
|
||||
try
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#if ! defined BOOST_THREAD_TEST_TIME_MS
|
||||
#ifdef BOOST_THREAD_PLATFORM_WIN32
|
||||
#define BOOST_THREAD_TEST_TIME_MS 250
|
||||
#else
|
||||
#ifdef __linux__
|
||||
#define BOOST_THREAD_TEST_TIME_MS 75
|
||||
#else
|
||||
// Windows, Cygwin, macOS all need this
|
||||
#define BOOST_THREAD_TEST_TIME_MS 400
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/condition.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef DEFAULT_EXECUTION_MONITOR_TYPE
|
||||
# define DEFAULT_EXECUTION_MONITOR_TYPE execution_monitor::use_condition
|
||||
@@ -133,6 +134,10 @@ class indirect_adapter
|
||||
public:
|
||||
indirect_adapter(F func, execution_monitor& monitor)
|
||||
: func(func), monitor(monitor) { }
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
indirect_adapter(indirect_adapter const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
try
|
||||
@@ -210,11 +215,15 @@ class thread_member_binder
|
||||
public:
|
||||
thread_member_binder(R (T::*func)(), T& param)
|
||||
: func(func), param(param) { }
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
thread_member_binder(thread_member_binder const&) = default;
|
||||
#endif
|
||||
|
||||
void operator()() const { (param.*func)(); }
|
||||
|
||||
private:
|
||||
void operator=(thread_member_binder&);
|
||||
|
||||
|
||||
R (T::*func)();
|
||||
T& param;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <iostream>
|
||||
|
||||
void helloworld(const char* who)
|
||||
|
||||
Reference in New Issue
Block a user