2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-09 23:42:18 +00:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Nikita Kniazev
7afa3e9fd4 Fixed optimized away hooks. Fixes #316
MSVC learned to not emit unreferenced symbols with internal linkage and the
hooks were defined in unnamed namespace which forces internal linkage, even if
you mark a variable `extern`.

Since Boost does not have a stable ABI, does not mangle the namespace with
the version, and the hooks are in `boost` namespace (`boost::on_*`) -- there is
no point in trying to hide some symbols because mixing different versions of
boost static libraries will not work already.

I also renamed the `__xl_ca` variable for consistency and because using double
underscored identifiers is forbidden. (`[lex.name]/3`)

The `extern const` is for verbosity and because they are indeed const (it is
done via pragma already).
2020-06-14 17:13:15 +03:00
Peter Dimov
49ece352b3 Update appveyor.yml 2020-04-07 05:17:17 +03:00
Peter Dimov
116e8f6eb8 Update appveyor.yml 2020-04-07 01:42:28 +03:00
Peter Dimov
66892e5ddd Update appveyor.yml 2020-04-07 00:53:19 +03:00
Peter Dimov
42a48f4b03 Update appveyor.yml 2020-04-06 19:21:50 +03:00
Peter Dimov
f33abfd621 Apply fixes for MinGW 2020-04-06 18:57:29 +03:00
Peter Dimov
0277d357ae Update appveyor.yml 2020-04-06 18:49:08 +03:00
Peter Dimov
e18ae7b173 Update appveyor.yml 2020-04-06 12:01:22 +03:00
Peter Dimov
119009f2d1 Increase BOOST_THREAD_TEST_TIME on Mac and Cygwin 2020-04-06 11:56:49 +03:00
Peter Dimov
9eee38db94 Try -j3 on Travis to see if it improves build times 2020-04-05 21:34:12 +03:00
Peter Dimov
3e59ecec49 Decrease the number of tested cxxstd levels 2020-04-05 16:56:02 +03:00
Peter Dimov
b1842da010 Fix g++ version checks 2020-04-05 15:16:35 +03:00
Peter Dimov
b0da8e291b Remove 14/1z from clang 3.5 2020-04-05 15:13:25 +03:00
Peter Dimov
1d436f9030 Add more 'quick' Travis configurations (that only test the headers) 2020-04-05 05:10:51 +03:00
Andrey Semashev
8ebd61c280 Avoid relying on implicit copy constructor/operator deprecated in C++11.
C++11 deprecates implicit default copy constructors and operators if the class
has user-defined destructor or copy constructor/operator. gcc 9 generates
warnings when this deprecated language feature is used. This commit fixes that
by providing user-defained copy constructors/operators where needed. The
added definitions are equivalent to the implicitly generated by the compiler.

For thread::id, removed copy constructor to allow the compiler generate all
set of constructors and assignment operators, including move.
2020-04-05 02:17:14 +03:00
20 changed files with 305 additions and 306 deletions

View File

@@ -4,13 +4,7 @@
language: cpp language: cpp
sudo: false os: linux
python: "2.7"
os:
- linux
- osx
branches: branches:
only: only:
@@ -29,123 +23,88 @@ matrix:
include: include:
- os: linux - os: linux
compiler: g++ compiler: g++-4.4
env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++11 SELF_CONTAINED_HEADER_TESTS=1 env: TOOLSET=gcc CXXSTD=98,0x HEADERS_ONLY=1
addons:
# - os: linux apt:
# compiler: g++-4.7 packages:
# env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11 - g++-4.4
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-4.7 - os: linux
# sources: compiler: g++-4.6
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=98,0x HEADERS_ONLY=1
# addons:
# - os: linux apt:
# compiler: g++-4.8 packages:
# env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11 - g++-4.6
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-4.8 - os: linux
# sources: compiler: g++-4.7
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
# addons:
# - os: linux apt:
# compiler: g++-4.9 packages:
# env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11 - g++-4.7
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-4.9 - os: linux
# sources: compiler: g++-4.8
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
# addons:
# - os: linux apt:
# compiler: g++-5 packages:
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++98 - g++-4.8
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-5 - os: linux
# sources: compiler: g++-4.9
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=03,11 HEADERS_ONLY=1
# addons:
# - os: linux apt:
# compiler: g++-5 packages:
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11 - g++-4.9
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-5 - os: linux
# sources: compiler: g++-5
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=03
# addons:
# - os: linux apt:
# compiler: g++-5 packages:
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 - g++-5
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-5 - os: linux
# sources: compiler: g++-5
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=11
# addons:
# - os: linux apt:
# compiler: g++-5 packages:
# env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++1z - g++-5
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# packages:
# - g++-5 - os: linux
# sources: compiler: g++-6
# - ubuntu-toolchain-r-test env: TOOLSET=gcc CXXSTD=14,1z HEADERS_ONLY=1
# addons:
# - os: linux apt:
# compiler: g++-6 packages:
# env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++98 - g++-6
# addons: sources:
# apt: - ubuntu-toolchain-r-test
# 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
- os: linux - os: linux
dist: trusty
compiler: g++-7 compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++98 env: TOOLSET=gcc CXXSTD=14,17 HEADERS_ONLY=1
addons: addons:
apt: apt:
packages: packages:
@@ -154,196 +113,177 @@ matrix:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- os: linux - os: linux
dist: trusty compiler: g++-8
compiler: g++-7 env: TOOLSET=gcc CXXSTD=14,17 HEADERS_ONLY=1
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++11
addons: addons:
apt: apt:
packages: 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: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- os: linux - os: linux
dist: trusty dist: trusty
compiler: g++-7 compiler: clang++-3.5
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++14 env: TOOLSET=clang CXXSTD=03,11 HEADERS_ONLY=1
addons: addons:
apt: apt:
packages: packages:
- g++-7 - clang-3.5
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- os: linux - os: linux
dist: trusty compiler: clang++-3.6
compiler: g++-7 env: TOOLSET=clang CXXSTD=03,11,14 HEADERS_ONLY=1
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=c++1z
addons: addons:
apt: apt:
packages: 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: sources:
- ubuntu-toolchain-r-test - 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 - os: linux
compiler: clang++-4.0 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: addons:
apt: apt:
packages: packages:
- clang-4.0 - clang-4.0
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux - os: linux
compiler: clang++-4.0 compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++11 env: TOOLSET=clang CXXSTD=03,11,14,1z HEADERS_ONLY=1
addons: addons:
apt: apt:
packages: packages:
- clang-4.0 - clang-5.0
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux - os: linux
compiler: clang++-4.0 compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++14 env: TOOLSET=clang CXXSTD=14,17 HEADERS_ONLY=1
addons: addons:
apt: apt:
packages: packages:
- clang-4.0 - clang-6.0
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux - os: linux
compiler: clang++-4.0 compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=c++1z env: TOOLSET=clang CXXSTD=14,17,2a HEADERS_ONLY=1
addons: addons:
apt: apt:
packages: packages:
- clang-4.0 - clang-7
sources: sources:
- ubuntu-toolchain-r-test - 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 - os: osx
compiler: clang++ compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++98 SELF_CONTAINED_HEADER_TESTS=1 env: TOOLSET=clang CXXSTD=98
# - os: osx # - os: osx
# compiler: clang++ # compiler: clang++
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 # env: TOOLSET=clang CXXSTD=11
# - os: osx # - os: osx
# compiler: clang++ # compiler: clang++
# env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 # env: TOOLSET=clang CXXSTD=14
- os: osx - os: osx
compiler: clang++ compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z env: TOOLSET=clang CXXSTD=1z
install: install:
- GIT_FETCH_JOBS=8 - GIT_FETCH_JOBS=8
@@ -364,10 +304,8 @@ install:
script: script:
- |- - |-
echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD ;" > ~/user-config.jam echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/user-config.jam
- BUILD_JOBS=`(nproc || sysctl -n hw.ncpu) 2> /dev/null` - ./b2 -j3 -l60 libs/thread/test${HEADERS_ONLY:+//test_self_contained_headers} toolset=$TOOLSET cxxstd=$CXXSTD
- 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
notifications: notifications:
email: email:

View File

@@ -13,39 +13,50 @@ branches:
- develop - develop
- /feature\/.*/ - /feature\/.*/
image: Visual Studio 2015
environment: environment:
matrix: matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 - TOOLSET: msvc-12.0
TOOLSET: msvc-12.0 VARIANT: release
SELF_CONTAINED_HEADER_TESTS: 1
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-14.0
TOOLSET: msvc-14.0
ADDRMD: 32 ADDRMD: 32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 VARIANT: debug
TOOLSET: msvc-14.1
- TOOLSET: msvc-14.1
ADDRMD: 64
VARIANT: release
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.2
CXXSTD: 17 CXXSTD: 17
ADDRMD: 64 ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 VARIANT: debug
ADDPATH: C:\cygwin\bin; APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- ADDPATH: C:\cygwin\bin;
TOOLSET: gcc TOOLSET: gcc
CXXSTD: 14 VARIANT: release
SELF_CONTAINED_HEADER_TESTS: 1
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - ADDPATH: C:\mingw\bin;
ADDPATH: C:\cygwin64\bin;
TOOLSET: gcc TOOLSET: gcc
CXXSTD: 14 VARIANT: debug
SELF_CONTAINED_HEADER_TESTS: 1
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # The following configurations fail with
ADDPATH: C:\mingw\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/
CXXSTD: 14 #
SELF_CONTAINED_HEADER_TESTS: 1 # - ADDPATH: C:\cygwin64\bin;
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # TOOLSET: gcc
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; # VARIANT: debug
TOOLSET: gcc # - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
CXXSTD: 14 # TOOLSET: gcc
SELF_CONTAINED_HEADER_TESTS: 1 # 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
@@ -67,7 +78,7 @@ build: off
test_script: test_script:
- PATH=%ADDPATH%%PATH% - 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 "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
- b2 -j %NUMBER_OF_PROCESSORS% --abbreviate-paths 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%

View File

@@ -20,6 +20,7 @@ struct func
int& i; int& i;
func(int& i_):i(i_){} func(int& i_):i(i_){}
func(func const& other):i(other.i){}
void operator()() void operator()()
{ {

View File

@@ -148,7 +148,7 @@ namespace detail
template <class Q, class T, template <class Q, class T,
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#if defined __GNUC__ && ! defined __clang__ #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 Copyable = is_copy_constructible<T>::value,
bool Movable = true bool Movable = true
#else #else

View File

@@ -140,7 +140,7 @@ namespace detail
template <class T, class ST, template <class T, class ST,
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#if defined __GNUC__ && ! defined __clang__ #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 Copyable = is_copy_constructible<T>::value,
bool Movable = true bool Movable = true
#else #else

View File

@@ -148,7 +148,7 @@ namespace detail
template <class Q, class T, template <class Q, class T,
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#if defined __GNUC__ && ! defined __clang__ #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 Copyable = is_copy_constructible<T>::value,
bool Movable = true bool Movable = true
#else #else

View File

@@ -140,7 +140,7 @@ namespace detail
template <class T, class ST, template <class T, class ST,
#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
#if defined __GNUC__ && ! defined __clang__ #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 Copyable = is_copy_constructible<T>::value,
bool Movable = true bool Movable = true
#else #else

View File

@@ -637,10 +637,6 @@ namespace boost
#endif #endif
{} {}
id(const id& other) BOOST_NOEXCEPT :
thread_data(other.thread_data)
{}
bool operator==(const id& y) const BOOST_NOEXCEPT bool operator==(const id& y) const BOOST_NOEXCEPT
{ {
return thread_data==y.thread_data; return thread_data==y.thread_data;

View File

@@ -152,19 +152,25 @@ extern BOOL (WINAPI * const _pDefaultRawDllMainOrig)(HINSTANCE, DWORD, LPVOID) =
static PVAPI_V on_process_init(); static PVAPI_V on_process_init();
static PVAPI_V on_process_term(); static PVAPI_V on_process_term();
static void NTAPI on_tls_callback(HINSTANCE, DWORD, PVOID); static void NTAPI on_tls_callback(HINSTANCE, DWORD, PVOID);
}
namespace boost
{
//The .CRT$Xxx information is taken from Codeguru: //The .CRT$Xxx information is taken from Codeguru:
//http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/ //http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/
// Variables below are not referenced anywhere and
// to not be optimized away has to have external linkage
#if (_MSC_VER >= 1400) #if (_MSC_VER >= 1400)
#pragma section(".CRT$XIU",long,read) #pragma section(".CRT$XIU",long,read)
#pragma section(".CRT$XCU",long,read) #pragma section(".CRT$XCU",long,read)
#pragma section(".CRT$XTU",long,read) #pragma section(".CRT$XTU",long,read)
#pragma section(".CRT$XLC",long,read) #pragma section(".CRT$XLC",long,read)
__declspec(allocate(".CRT$XLC")) _TLSCB __xl_ca=on_tls_callback; extern const __declspec(allocate(".CRT$XLC")) _TLSCB p_tls_callback = on_tls_callback;
__declspec(allocate(".CRT$XIU"))_PIFV_ p_tls_prepare = on_tls_prepare; extern const __declspec(allocate(".CRT$XIU")) _PIFV_ p_tls_prepare = on_tls_prepare;
__declspec(allocate(".CRT$XCU"))_PVFV_ p_process_init = on_process_init; extern const __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$XTU")) _PVFV_ p_process_term = on_process_term;
#else #else
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0 #if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
# pragma data_seg(push, old_seg) # 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. //this could be changed easily if required.
#pragma data_seg(".CRT$XIU") #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() #pragma data_seg()
//Callback after all global ctors. //Callback after all global ctors.
#pragma data_seg(".CRT$XCU") #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() #pragma data_seg()
//Callback for tls notifications. //Callback for tls notifications.
#pragma data_seg(".CRT$XLB") #pragma data_seg(".CRT$XLB")
_TLSCB p_thread_callback = on_tls_callback; extern const _TLSCB p_thread_callback = on_tls_callback;
#pragma data_seg() #pragma data_seg()
//Callback for termination. //Callback for termination.
#pragma data_seg(".CRT$XTU") #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() #pragma data_seg()
#if (_MSC_VER >= 1300) // 1300 == VC++ 7.0 #if (_MSC_VER >= 1300) // 1300 == VC++ 7.0
# pragma data_seg(pop, old_seg) # pragma data_seg(pop, old_seg)
#endif #endif
#endif #endif
} // namespace boost
namespace
{
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4189) #pragma warning(disable:4189)

View File

@@ -7,6 +7,7 @@
// accompanying file LICENSE_1_0.txt or copy at // 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)
#include <boost/config.hpp>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp> #include <boost/thread/condition_variable.hpp>
#include <boost/thread/shared_mutex.hpp> #include <boost/thread/shared_mutex.hpp>
@@ -38,6 +39,10 @@ public:
finish_mutex(finish_mutex_) finish_mutex(finish_mutex_)
{} {}
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
locking_thread(locking_thread const&) = default;
#endif
void operator()() void operator()()
{ {
// acquire lock // acquire lock
@@ -84,6 +89,10 @@ public:
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_) 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()() void operator()()
{ {
boost::unique_lock<boost::shared_mutex> lk(rwm); boost::unique_lock<boost::shared_mutex> lk(rwm);
@@ -115,6 +124,10 @@ public:
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_) 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()() void operator()()
{ {
boost::shared_lock<boost::shared_mutex> lk(rwm); boost::shared_lock<boost::shared_mutex> lk(rwm);

View File

@@ -23,6 +23,7 @@
#include <boost/thread/future.hpp> #include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/config.hpp>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(disable: 4702) // unreachable code # pragma warning(disable: 4702) // unreachable code
@@ -37,6 +38,9 @@ struct A
{ {
throw 10; throw 10;
} }
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
A& operator= (const A&) = default;
#endif
}; };
int main() int main()

View File

@@ -14,6 +14,7 @@
#include <boost/thread/thread_only.hpp> #include <boost/thread/thread_only.hpp>
#include <boost/thread/xtime.hpp> #include <boost/thread/xtime.hpp>
#include <boost/config.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include "./util.inl" #include "./util.inl"
@@ -41,14 +42,17 @@ void condition_test_thread(condition_test_data* data)
struct cond_predicate struct cond_predicate
{ {
cond_predicate(int& var, int val) : _var(var), _val(val) { } 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; } bool operator()() { return _var == _val; }
int& _var; int& _var;
int _val; int _val;
private: private:
void operator=(cond_predicate&); void operator=(cond_predicate&);
}; };
void condition_test_waits(condition_test_data* data) void condition_test_waits(condition_test_data* data)

View File

@@ -12,7 +12,12 @@
BOOST_AUTO_TEST_CASE(test_physical_concurrency_is_non_zero) 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); BOOST_CHECK(boost::thread::physical_concurrency()!=0);
#endif
} }

View File

@@ -6,6 +6,7 @@
#define BOOST_THREAD_VERSION 2 #define BOOST_THREAD_VERSION 2
#define BOOST_TEST_MODULE Boost.Threads: shared_mutex_part2 test suite #define BOOST_TEST_MODULE Boost.Threads: shared_mutex_part2 test suite
#include <boost/config.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp> #include <boost/thread/xtime.hpp>
@@ -36,6 +37,10 @@ public:
unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_) 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()() void operator()()
{ {
boost::upgrade_lock<boost::shared_mutex> lk(rwm); boost::upgrade_lock<boost::shared_mutex> lk(rwm);

View File

@@ -205,7 +205,10 @@ void do_test_tss()
// Also this usually will be triggered only when bound to the static version of thread lib. // Also this usually will be triggered only when bound to the static version of thread lib.
// 2006-10-02 Roland Schwarz // 2006-10-02 Roland Schwarz
//BOOST_CHECK_EQUAL(tss_instances, 0); //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"); BOOST_CHECK_MESSAGE(tss_instances == 0, "Support of automatic tss cleanup for native threading API not available");
#endif
BOOST_CHECK_EQUAL(tss_total, 5); BOOST_CHECK_EQUAL(tss_total, 5);
} }

View File

@@ -106,7 +106,7 @@ int main()
BOOST_TEST(f_run == true); BOOST_TEST(f_run == true);
std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl; std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl;
} }
#ifndef BOOST_MSVC #if !defined(BOOST_MSVC) && !defined(__MINGW32__)
f_run = false; f_run = false;
{ {
std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl; std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl;

View File

@@ -102,7 +102,7 @@ int main()
BOOST_TEST(f_run == true); BOOST_TEST(f_run == true);
} }
f_run = false; f_run = false;
#ifndef BOOST_MSVC #if !defined(BOOST_MSVC) && !defined(__MINGW32__)
{ {
try try
{ {
@@ -125,7 +125,7 @@ int main()
BOOST_TEST(G::n_alive == 0); BOOST_TEST(G::n_alive == 0);
BOOST_TEST(G::op_run); BOOST_TEST(G::op_run);
} }
#ifndef BOOST_MSVC #if !defined(BOOST_MSVC) && !defined(__MINGW32__)
G::op_run = false; G::op_run = false;
{ {
try try

View File

@@ -61,7 +61,7 @@ int main()
t.join(); t.join();
BOOST_TEST(f_run == true); BOOST_TEST(f_run == true);
} }
#ifndef BOOST_MSVC #if !defined(BOOST_MSVC) && !defined(__MINGW32__)
{ {
f_run = false; f_run = false;
try try

View File

@@ -10,10 +10,11 @@
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#if ! defined BOOST_THREAD_TEST_TIME_MS #if ! defined BOOST_THREAD_TEST_TIME_MS
#ifdef BOOST_THREAD_PLATFORM_WIN32 #ifdef __linux__
#define BOOST_THREAD_TEST_TIME_MS 250
#else
#define BOOST_THREAD_TEST_TIME_MS 75 #define BOOST_THREAD_TEST_TIME_MS 75
#else
// Windows, Cygwin, macOS all need this
#define BOOST_THREAD_TEST_TIME_MS 250
#endif #endif
#endif #endif

View File

@@ -12,6 +12,7 @@
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp> #include <boost/thread/condition.hpp>
#include <boost/thread/thread.hpp> #include <boost/thread/thread.hpp>
#include <boost/config.hpp>
#ifndef DEFAULT_EXECUTION_MONITOR_TYPE #ifndef DEFAULT_EXECUTION_MONITOR_TYPE
# define DEFAULT_EXECUTION_MONITOR_TYPE execution_monitor::use_condition # define DEFAULT_EXECUTION_MONITOR_TYPE execution_monitor::use_condition
@@ -133,6 +134,10 @@ class indirect_adapter
public: public:
indirect_adapter(F func, execution_monitor& monitor) indirect_adapter(F func, execution_monitor& monitor)
: func(func), monitor(monitor) { } : func(func), monitor(monitor) { }
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
indirect_adapter(indirect_adapter const&) = default;
#endif
void operator()() const void operator()() const
{ {
try try
@@ -210,11 +215,15 @@ class thread_member_binder
public: public:
thread_member_binder(R (T::*func)(), T& param) thread_member_binder(R (T::*func)(), T& param)
: func(func), param(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)(); } void operator()() const { (param.*func)(); }
private: private:
void operator=(thread_member_binder&); void operator=(thread_member_binder&);
R (T::*func)(); R (T::*func)();
T& param; T& param;
}; };