mirror of
https://github.com/boostorg/thread.git
synced 2026-02-13 12:52:11 +00:00
Compare commits
10 Commits
feature/up
...
feature/pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7afa3e9fd4 | ||
|
|
49ece352b3 | ||
|
|
116e8f6eb8 | ||
|
|
66892e5ddd | ||
|
|
42a48f4b03 | ||
|
|
f33abfd621 | ||
|
|
0277d357ae | ||
|
|
e18ae7b173 | ||
|
|
119009f2d1 | ||
|
|
9eee38db94 |
@@ -305,8 +305,7 @@ install:
|
|||||||
script:
|
script:
|
||||||
- |-
|
- |-
|
||||||
echo "using $TOOLSET : : $TRAVIS_COMPILER ;" > ~/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
|
||||||
- ./b2 -j $BUILD_JOBS -l60 libs/thread/test${HEADERS_ONLY:+//test_self_contained_headers} toolset=$TOOLSET cxxstd=$CXXSTD
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
|
|||||||
67
appveyor.yml
67
appveyor.yml
@@ -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%
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user