mirror of
https://github.com/boostorg/thread.git
synced 2026-02-03 21:52:07 +00:00
Compare commits
30 Commits
feature/is
...
boost-1.86
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aec18d337f | ||
|
|
54a28e4d54 | ||
|
|
9d73a06e06 | ||
|
|
527a56f242 | ||
|
|
f1003a9a5f | ||
|
|
710e6fd278 | ||
|
|
5cbc8db036 | ||
|
|
caa7c111d2 | ||
|
|
a513e53043 | ||
|
|
5fb09cd1c1 | ||
|
|
515d95c441 | ||
|
|
32d8199b6c | ||
|
|
d0264d6813 | ||
|
|
cf06d84362 | ||
|
|
ccc5e3142c | ||
|
|
97060416f1 | ||
|
|
88e32fd1ac | ||
|
|
5f41e68838 | ||
|
|
7d570f70d8 | ||
|
|
e62d29f917 | ||
|
|
09f01fbb05 | ||
|
|
fadb514c71 | ||
|
|
30dcb6dcbc | ||
|
|
27cb703930 | ||
|
|
d56f3f25ad | ||
|
|
52b62ee7b0 | ||
|
|
78af23ca14 | ||
|
|
743d19d7d3 | ||
|
|
7f7faf234d | ||
|
|
4bc126fc37 |
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -18,35 +18,58 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- toolset: gcc-4.8
|
||||
os: ubuntu-18.04
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:18.04
|
||||
cxxstd: 11
|
||||
install: g++-4.8
|
||||
- toolset: gcc-5
|
||||
cxxstd: 11
|
||||
os: ubuntu-18.04
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:18.04
|
||||
install: g++-5
|
||||
- toolset: gcc-7
|
||||
os: ubuntu-18.04
|
||||
os: ubuntu-20.04
|
||||
install: g++-7
|
||||
- toolset: gcc-9
|
||||
os: ubuntu-20.04
|
||||
- toolset: gcc-11
|
||||
os: ubuntu-20.04
|
||||
install: g++-11
|
||||
os: ubuntu-22.04
|
||||
- toolset: clang
|
||||
compiler: clang++-12
|
||||
compiler: clang++-15
|
||||
cxxstd: 20
|
||||
os: ubuntu-20.04
|
||||
install: clang-12
|
||||
os: ubuntu-22.04
|
||||
install: clang-15
|
||||
- toolset: clang
|
||||
os: macos-10.15
|
||||
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@v2
|
||||
- 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 install ${{matrix.install}}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@@ -66,7 +89,7 @@ jobs:
|
||||
cd boost-root
|
||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Generated by `boostdep --cmake thread`
|
||||
# Copyright 2020 Peter Dimov
|
||||
# Copyright 2020, 2021 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)
|
||||
cmake_minimum_required(VERSION 3.8...3.20)
|
||||
|
||||
project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
@@ -63,9 +63,7 @@ target_link_libraries(boost_thread
|
||||
Boost::date_time
|
||||
Boost::exception
|
||||
Boost::function
|
||||
Boost::intrusive
|
||||
Boost::io
|
||||
Boost::iterator
|
||||
Boost::move
|
||||
Boost::optional
|
||||
Boost::predef
|
||||
@@ -80,12 +78,10 @@ target_link_libraries(boost_thread
|
||||
Boost::winapi
|
||||
|
||||
Threads::Threads
|
||||
|
||||
PRIVATE
|
||||
Boost::algorithm
|
||||
Boost::lexical_cast
|
||||
)
|
||||
|
||||
target_compile_features(boost_thread PUBLIC cxx_std_11)
|
||||
|
||||
target_compile_definitions(boost_thread
|
||||
PUBLIC BOOST_THREAD_NO_LIB
|
||||
PRIVATE BOOST_THREAD_SOURCE
|
||||
@@ -102,4 +98,3 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||
add_subdirectory(test)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
25
appveyor.yml
25
appveyor.yml
@@ -18,9 +18,6 @@ image: Visual Studio 2015
|
||||
environment:
|
||||
matrix:
|
||||
|
||||
- TOOLSET: msvc-12.0
|
||||
VARIANT: release
|
||||
|
||||
- TOOLSET: msvc-14.0
|
||||
ADDRMD: 32
|
||||
VARIANT: debug
|
||||
@@ -45,23 +42,17 @@ environment:
|
||||
TOOLSET: gcc
|
||||
VARIANT: release
|
||||
|
||||
- ADDPATH: C:\mingw\bin;
|
||||
- ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
VARIANT: debug
|
||||
|
||||
# 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/
|
||||
#
|
||||
# - 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
|
||||
- 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: release
|
||||
|
||||
install:
|
||||
- set GIT_FETCH_JOBS=8
|
||||
|
||||
@@ -9,37 +9,14 @@
|
||||
#ifndef BOOST_CSBL_DEQUE_HPP
|
||||
#define BOOST_CSBL_DEQUE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
// MSVC has some trouble instantiating a non_copyable type
|
||||
//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable'
|
||||
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable'
|
||||
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable'
|
||||
// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)'
|
||||
// with
|
||||
// [
|
||||
// _Ty=non_copyable
|
||||
// ]
|
||||
#if defined BOOST_THREAD_USES_BOOST_DEQUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827)
|
||||
#ifndef BOOST_THREAD_USES_BOOST_DEQUE
|
||||
#define BOOST_THREAD_USES_BOOST_DEQUE
|
||||
#endif
|
||||
#include <boost/container/deque.hpp>
|
||||
#else
|
||||
#include <deque>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_DEQUE
|
||||
using ::boost::container::deque;
|
||||
|
||||
#else
|
||||
using ::std::deque;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -9,24 +9,12 @@
|
||||
#ifndef BOOST_CSBL_FUNCTIONAL_HPP
|
||||
#define BOOST_CSBL_FUNCTIONAL_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL || defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#ifndef BOOST_THREAD_USES_BOOST_FUNCTIONAL
|
||||
#define BOOST_THREAD_USES_BOOST_FUNCTIONAL
|
||||
#endif
|
||||
#include <boost/function.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL
|
||||
using ::boost::function;
|
||||
#else
|
||||
// D.8.1, base (deprecated):
|
||||
// 20.9.3, reference_wrapper:
|
||||
// 20.9.4, arithmetic operations:
|
||||
@@ -42,8 +30,7 @@ namespace boost
|
||||
// 20.9.11 polymorphic function wrappers:
|
||||
using ::std::function;
|
||||
// 20.9.12, hash function primary template:
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -9,27 +9,14 @@
|
||||
#ifndef BOOST_CSBL_LIST_HPP
|
||||
#define BOOST_CSBL_LIST_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_BOOST_LIST || defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#ifndef BOOST_THREAD_USES_BOOST_LIST
|
||||
#define BOOST_THREAD_USES_BOOST_LIST
|
||||
#endif
|
||||
#include <boost/container/list.hpp>
|
||||
#else
|
||||
#include <list>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_LIST
|
||||
using ::boost::container::list;
|
||||
#else
|
||||
using ::std::list;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -12,18 +12,7 @@
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
// 20.7.6, allocator argument tag
|
||||
#if defined BOOST_NO_CXX11_ALLOCATOR
|
||||
#include <boost/container/scoped_allocator.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::container::allocator_arg_t;
|
||||
using ::boost::container::allocator_arg;
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -32,10 +21,11 @@ namespace boost
|
||||
using ::std::allocator_arg;
|
||||
}
|
||||
}
|
||||
#endif // BOOST_NO_CXX11_ALLOCATOR
|
||||
|
||||
namespace boost
|
||||
{
|
||||
using ::boost::csbl::allocator_arg_t;
|
||||
using ::boost::csbl::allocator_arg;
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -12,17 +12,7 @@
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
// 20.7.8, allocator traits
|
||||
#if defined BOOST_NO_CXX11_ALLOCATOR
|
||||
#include <boost/container/allocator_traits.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::container::allocator_traits;
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -30,6 +20,5 @@ namespace boost
|
||||
using ::std::allocator_traits;
|
||||
}
|
||||
}
|
||||
#endif // BOOST_NO_CXX11_POINTER_TRAITS
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#ifndef BOOST_CSBL_MEMORY_CONFIG_HPP
|
||||
#define BOOST_CSBL_MEMORY_CONFIG_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -14,17 +14,6 @@
|
||||
// 20.8.1 class template unique_ptr:
|
||||
// default_delete
|
||||
|
||||
#if defined BOOST_NO_CXX11_SMART_PTR
|
||||
#include <boost/move/unique_ptr.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::movelib::default_delete;
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -32,10 +21,5 @@ namespace boost
|
||||
using ::std::default_delete;
|
||||
}
|
||||
}
|
||||
#endif // defined BOOST_NO_CXX11_SMART_PTR
|
||||
|
||||
namespace boost
|
||||
{
|
||||
using ::boost::csbl::default_delete;
|
||||
}
|
||||
#endif // header
|
||||
|
||||
@@ -12,17 +12,7 @@
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
// 20.7.3, pointer traits
|
||||
#if defined BOOST_NO_CXX11_ALLOCATOR
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::intrusive::pointer_traits;
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -30,6 +20,5 @@ namespace boost
|
||||
using ::std::pointer_traits;
|
||||
}
|
||||
}
|
||||
#endif // BOOST_NO_CXX11_ALLOCATOR
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -12,17 +12,7 @@
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
// 20.7.7, uses_allocator
|
||||
#if defined BOOST_NO_CXX11_ALLOCATOR
|
||||
#include <boost/container/scoped_allocator.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::container::uses_allocator;
|
||||
}
|
||||
}
|
||||
#else
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -30,6 +20,5 @@ namespace boost
|
||||
using ::std::uses_allocator;
|
||||
}
|
||||
}
|
||||
#endif // BOOST_NO_CXX11_POINTER_TRAITS
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -11,24 +11,6 @@
|
||||
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
#if defined BOOST_NO_CXX11_SMART_PTR
|
||||
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::shared_ptr;
|
||||
using ::boost::make_shared;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
@@ -38,5 +20,4 @@ namespace boost
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // header
|
||||
|
||||
@@ -12,17 +12,15 @@
|
||||
#define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
|
||||
|
||||
#include <boost/thread/csbl/memory/config.hpp>
|
||||
|
||||
#include <boost/move/unique_ptr.hpp>
|
||||
#include <boost/move/make_unique.hpp>
|
||||
#include <boost/smart_ptr/make_unique.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
using ::boost::movelib::unique_ptr;
|
||||
using ::boost::movelib::make_unique;
|
||||
|
||||
using ::std::unique_ptr;
|
||||
using ::boost::make_unique;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -5,42 +5,18 @@
|
||||
//
|
||||
// 2013/10 Vicente J. Botet Escriba
|
||||
// Creation.
|
||||
#if 0
|
||||
|
||||
#ifndef BOOST_CSBL_QUEUE_HPP
|
||||
#define BOOST_CSBL_QUEUE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
// MSVC has some trouble instantiating a non_copyable type
|
||||
//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable'
|
||||
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable'
|
||||
// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable'
|
||||
// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)'
|
||||
// with
|
||||
// [
|
||||
// _Ty=non_copyable
|
||||
// ]
|
||||
#if defined BOOST_THREAD_USES_BOOST_QUEUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827)
|
||||
#ifndef BOOST_THREAD_USES_BOOST_QUEUE
|
||||
#define BOOST_THREAD_USES_BOOST_QUEUE
|
||||
#endif
|
||||
#include <boost/container/queue.hpp>
|
||||
#else
|
||||
#include <queue>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_QUEUE
|
||||
using ::boost::container::queue;
|
||||
|
||||
#else
|
||||
using ::std::queue;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
#endif
|
||||
|
||||
@@ -9,28 +9,12 @@
|
||||
#ifndef BOOST_CSBL_TUPLE_HPP
|
||||
#define BOOST_CSBL_TUPLE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_BOOST_TUPLE || defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#ifndef BOOST_THREAD_USES_BOOST_TUPLE
|
||||
#define BOOST_THREAD_USES_BOOST_TUPLE
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include <tuple>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_TUPLE
|
||||
using ::boost::tuple;
|
||||
using ::boost::get;
|
||||
using ::boost::make_tuple;
|
||||
//using ::boost::tuple_size;
|
||||
#else
|
||||
// 20.4.2, class template tuple:
|
||||
using ::std::tuple;
|
||||
using ::std::get;
|
||||
@@ -42,8 +26,7 @@ namespace boost
|
||||
// 20.4.2.7, relational operators:
|
||||
// 20.4.2.8, allocator-related traits
|
||||
// 20.4.2.9, specialized algorithms:
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -9,27 +9,14 @@
|
||||
#ifndef BOOST_CSBL_VECTOR_HPP
|
||||
#define BOOST_CSBL_VECTOR_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_BOOST_VECTOR || defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC
|
||||
#ifndef BOOST_THREAD_USES_BOOST_VECTOR
|
||||
#define BOOST_THREAD_USES_BOOST_VECTOR
|
||||
#endif
|
||||
#include <boost/container/vector.hpp>
|
||||
#else
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace csbl
|
||||
{
|
||||
#if defined BOOST_THREAD_USES_BOOST_VECTOR
|
||||
using ::boost::container::vector;
|
||||
#else
|
||||
using ::std::vector;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // header
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_object_pointer.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
#include <functional>
|
||||
@@ -85,7 +86,13 @@ namespace boost
|
||||
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class Fp, class A0>
|
||||
// enable_if avoids
|
||||
//
|
||||
// ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039
|
||||
// https://sourceforge.net/p/mingw-w64/bugs/694/
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756
|
||||
|
||||
template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
|
||||
inline auto
|
||||
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
|
||||
-> decltype(boost::forward<A0>(a0).*f)
|
||||
@@ -93,7 +100,7 @@ namespace boost
|
||||
return boost::forward<A0>(a0).*f;
|
||||
}
|
||||
|
||||
template <class Fp, class A0>
|
||||
template <class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
|
||||
inline auto
|
||||
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
|
||||
-> decltype((*boost::forward<A0>(a0)).*f)
|
||||
@@ -101,7 +108,7 @@ namespace boost
|
||||
return (*boost::forward<A0>(a0)).*f;
|
||||
}
|
||||
|
||||
template <class R, class Fp, class A0>
|
||||
template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
|
||||
inline auto
|
||||
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
|
||||
-> decltype(boost::forward<A0>(a0).*f)
|
||||
@@ -109,7 +116,7 @@ namespace boost
|
||||
return boost::forward<A0>(a0).*f;
|
||||
}
|
||||
|
||||
template <class R, class Fp, class A0>
|
||||
template <class R, class Fp, class A0, class En = typename boost::enable_if<boost::is_member_object_pointer<Fp> >::type>
|
||||
inline auto
|
||||
invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0)
|
||||
-> decltype((*boost::forward<A0>(a0)).*f)
|
||||
|
||||
55
include/boost/thread/detail/string_to_unsigned.hpp
Normal file
55
include/boost/thread/detail/string_to_unsigned.hpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED
|
||||
#define BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED
|
||||
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <string>
|
||||
#include <climits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace thread_detail
|
||||
{
|
||||
|
||||
inline bool string_to_unsigned( std::string const& s, unsigned& v )
|
||||
{
|
||||
v = 0;
|
||||
|
||||
if( s.empty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for( char const* p = s.c_str(); *p; ++p )
|
||||
{
|
||||
unsigned char ch = static_cast<unsigned char>( *p );
|
||||
|
||||
if( ch < '0' || ch > '9' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( v > UINT_MAX / 10 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned q = static_cast<unsigned>( ch - '0' );
|
||||
|
||||
if( v == UINT_MAX / 10 && q > UINT_MAX % 10 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
v = v * 10 + q;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace thread_detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED
|
||||
29
include/boost/thread/detail/string_trim.hpp
Normal file
29
include/boost/thread/detail/string_trim.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
|
||||
#define BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
|
||||
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace thread_detail
|
||||
{
|
||||
|
||||
inline std::string string_trim( std::string const& s )
|
||||
{
|
||||
std::size_t i = s.find_first_not_of( " \t\r\n" );
|
||||
|
||||
if( i == std::string::npos ) return std::string();
|
||||
|
||||
std::size_t j = s.find_last_not_of( " \t\r\n" );
|
||||
|
||||
return s.substr( i, j + 1 - i );
|
||||
}
|
||||
|
||||
} // namespace thread_detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED
|
||||
@@ -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.
|
||||
|
||||
@@ -63,7 +63,6 @@ struct shared_state_base {
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/next_prior.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
#include <iterator>
|
||||
@@ -155,7 +154,9 @@ namespace boost
|
||||
{
|
||||
waiter.add(*current);
|
||||
}
|
||||
return boost::next(begin, waiter.wait());
|
||||
|
||||
std::advance( begin, waiter.wait() );
|
||||
return begin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
"Vicente J. Botet Escriba <vicente.botet -at- wanadoo.fr>"
|
||||
],
|
||||
"description":
|
||||
"Portable C++ multi-threading. C++03, C++11, C++14, C++17.",
|
||||
"Portable C++ multi-threading. C++11, C++14, C++17.",
|
||||
"std": [ "proposal" ],
|
||||
"category": [
|
||||
"Concurrent", "System"
|
||||
],
|
||||
"cxxstd": "03"
|
||||
"cxxstd": "11"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/pthread/pthread_helpers.hpp>
|
||||
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
|
||||
#include <boost/thread/detail/string_trim.hpp>
|
||||
#include <boost/thread/detail/string_to_unsigned.hpp>
|
||||
|
||||
#ifdef __GLIBC__
|
||||
#include <sys/sysinfo.h>
|
||||
@@ -33,10 +35,6 @@
|
||||
#include <vxCpuLib.h>
|
||||
#endif
|
||||
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <set>
|
||||
@@ -535,24 +533,36 @@ namespace boost
|
||||
if (line.empty())
|
||||
continue;
|
||||
|
||||
vector<string> key_val(2);
|
||||
boost::split(key_val, line, boost::is_any_of(":"));
|
||||
std::size_t i = line.find( ':' );
|
||||
|
||||
if (key_val.size() != 2)
|
||||
return hardware_concurrency();
|
||||
if( i == std::string::npos )
|
||||
{
|
||||
return hardware_concurrency();
|
||||
}
|
||||
|
||||
string key = key_val[0];
|
||||
string value = key_val[1];
|
||||
boost::trim(key);
|
||||
boost::trim(value);
|
||||
std::string key = line.substr( 0, i );
|
||||
std::string value = line.substr( i+1 );
|
||||
|
||||
key = thread_detail::string_trim( key );
|
||||
value = thread_detail::string_trim( value );
|
||||
|
||||
if (key == physical_id) {
|
||||
current_core_entry.first = boost::lexical_cast<unsigned>(value);
|
||||
|
||||
if( !thread_detail::string_to_unsigned( value, current_core_entry.first ) )
|
||||
{
|
||||
return hardware_concurrency();
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key == core_id) {
|
||||
current_core_entry.second = boost::lexical_cast<unsigned>(value);
|
||||
|
||||
if( !thread_detail::string_to_unsigned( value, current_core_entry.second ) )
|
||||
{
|
||||
return hardware_concurrency();
|
||||
}
|
||||
|
||||
cores.insert(current_core_entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1099,4 +1099,10 @@ rule generate_self_contained_header_tests
|
||||
;
|
||||
|
||||
test-suite test_self_contained_headers : [ generate_self_contained_header_tests ] ;
|
||||
|
||||
test-suite detail
|
||||
:
|
||||
[ run detail/string_trim_test.cpp ]
|
||||
[ run detail/string_to_unsigned_test.cpp ]
|
||||
;
|
||||
}
|
||||
|
||||
55
test/detail/string_to_unsigned_test.cpp
Normal file
55
test/detail/string_to_unsigned_test.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/thread/detail/string_to_unsigned.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::thread_detail::string_to_unsigned;
|
||||
|
||||
unsigned v;
|
||||
|
||||
BOOST_TEST_NOT( string_to_unsigned( "", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( " ", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "+1", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "-1", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "abc", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
|
||||
BOOST_TEST( string_to_unsigned( "0", v ) ) && BOOST_TEST_EQ( v, 0 );
|
||||
BOOST_TEST( string_to_unsigned( "1", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "12", v ) ) && BOOST_TEST_EQ( v, 12 );
|
||||
BOOST_TEST( string_to_unsigned( "123", v ) ) && BOOST_TEST_EQ( v, 123 );
|
||||
BOOST_TEST( string_to_unsigned( "1234", v ) ) && BOOST_TEST_EQ( v, 1234 );
|
||||
BOOST_TEST( string_to_unsigned( "12345", v ) ) && BOOST_TEST_EQ( v, 12345 );
|
||||
BOOST_TEST( string_to_unsigned( "123456", v ) ) && BOOST_TEST_EQ( v, 123456 );
|
||||
BOOST_TEST( string_to_unsigned( "1234567", v ) ) && BOOST_TEST_EQ( v, 1234567 );
|
||||
BOOST_TEST( string_to_unsigned( "12345678", v ) ) && BOOST_TEST_EQ( v, 12345678 );
|
||||
BOOST_TEST( string_to_unsigned( "123456789", v ) ) && BOOST_TEST_EQ( v, 123456789 );
|
||||
BOOST_TEST( string_to_unsigned( "1234567890", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "12345678901", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "123456789012", v ) ) && BOOST_TEST_EQ( v, 1234567890 );
|
||||
|
||||
BOOST_TEST( string_to_unsigned( "4294967295", v ) ) && BOOST_TEST_EQ( v, 4294967295 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "4294967296", v ) ) && BOOST_TEST_EQ( v, 429496729 );
|
||||
|
||||
BOOST_TEST( string_to_unsigned( "01", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "0001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "00001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "0000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "00000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "0000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "00000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "0000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST( string_to_unsigned( "00000000000001", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
|
||||
BOOST_TEST_NOT( string_to_unsigned( "1a", v ) ) && BOOST_TEST_EQ( v, 1 );
|
||||
BOOST_TEST_NOT( string_to_unsigned( "2 ", v ) ) && BOOST_TEST_EQ( v, 2 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
48
test/detail/string_trim_test.cpp
Normal file
48
test/detail/string_trim_test.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/thread/detail/string_trim.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::thread_detail::string_trim;
|
||||
|
||||
BOOST_TEST_EQ( string_trim( "" ), std::string( "" ) );
|
||||
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
|
||||
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
|
||||
BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( " \t\r\n \t\r\n" ), std::string( "" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( "a" ), std::string( "a" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( "a b" ), std::string( "a b" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) );
|
||||
|
||||
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
|
||||
BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -27,11 +27,11 @@ static void double_interrupt()
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ static void double_interrupt()
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ static void double_interrupt()
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
BOOST_TEST( true ); // perform lwt initialization
|
||||
|
||||
std::cout << "Start" << std::endl;
|
||||
double_interrupt();
|
||||
std::cout << "End" << std::endl;
|
||||
|
||||
return boost::report_errors();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#define BOOST_THREAD_TEST_TIME_MS 75
|
||||
#else
|
||||
// Windows, Cygwin, macOS all need this
|
||||
#define BOOST_THREAD_TEST_TIME_MS 250
|
||||
#define BOOST_THREAD_TEST_TIME_MS 400
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user