2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-03 21:52:07 +00:00

Compare commits

..

18 Commits

Author SHA1 Message Date
Peter Dimov
a1f89c9518 Merge pull request #403 from grafikrobot/modular
Add support for modular build structure.
2025-05-02 19:21:55 +03:00
Rene Rivera
28d58852bb Move the include usage req to the library build target. 2025-04-14 20:26:31 -05:00
Rene Rivera
4e0a88853a Sync from upstream. 2025-04-04 21:39:22 -05:00
Peter Dimov
5d68c9c42c Merge pull request #408 from arvid-norlander/bugfix/fix-build-on-clang-19
Fix build on clang-19
2025-03-12 04:05:27 +02:00
Peter Dimov
b3183638cb Update ci.yml 2025-03-12 03:19:41 +02:00
Peter Dimov
48482ff696 Apply Node20 workaround 2024-12-15 20:49:55 +02:00
Peter Dimov
76411e5918 Update ci.yml 2024-12-15 20:49:55 +02:00
Arvid Norlander
49ccf9c30a Fix build on clang-19 (which checks more things in uninstantiated templates)
Fixes issue #402
2024-11-08 16:48:43 +01:00
Rene Rivera
814ed9f341 Update build deps. 2024-08-09 22:26:06 -05:00
Rene Rivera
82aa252a9e Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:22 -05:00
Rene Rivera
b1ff784e51 Update copyright dates. 2024-07-20 22:52:03 -05:00
Rene Rivera
e6e4e53807 Bump B2 require to 5.2 2024-06-14 11:33:56 -05:00
Rene Rivera
0fc00ec05c Update dependencies. 2024-05-13 21:47:48 -05:00
Rene Rivera
435a623e48 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Rene Rivera
ca4b54f96c Add missing NO_LIB usage requirements. 2024-04-28 20:17:11 -05:00
Rene Rivera
43bfe9cbd2 Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:16:00 -05:00
Rene Rivera
691b64d5aa Put back removing qualified boostcpp tag. As we need it until the Jamroot removes the qualified tag. 2024-03-17 18:34:13 -05:00
Rene Rivera
e2de571359 Make the library modular usable. 2024-03-11 08:38:17 -05:00
6 changed files with 114 additions and 40 deletions

View File

@@ -18,52 +18,71 @@ jobs:
matrix:
include:
- toolset: gcc-4.8
os: ubuntu-latest
container: ubuntu:18.04
cxxstd: 11
container: ubuntu:18.04
os: ubuntu-latest
install: g++-4.8
- toolset: gcc-5
cxxstd: 11
os: ubuntu-latest
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5
- toolset: gcc-7
os: ubuntu-20.04
install: g++-7
container: ubuntu:18.04
os: ubuntu-latest
- toolset: gcc-9
os: ubuntu-20.04
container: ubuntu:20.04
os: ubuntu-latest
- toolset: gcc-11
os: ubuntu-22.04
- toolset: gcc-13
os: ubuntu-24.04
- toolset: clang
container: ubuntu:20.04
os: ubuntu-latest
install: clang
- 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
cxxstd: 20
os: ubuntu-24.04
- toolset: clang
os: macos-13
cxxstd: 11
- toolset: clang
os: macos-14
cxxstd: 14
- toolset: clang
os: macos-15
cxxstd: 17
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
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++
apt-get -y install sudo python3 git g++ curl xz-utils
- name: Install nodejs20glibc2.17
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
run: |
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install

46
build.jam Normal file
View File

@@ -0,0 +1,46 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.2 ;
constant boost_dependencies :
/boost/assert//boost_assert
/boost/atomic//boost_atomic
/boost/bind//boost_bind
/boost/chrono//boost_chrono
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/container//boost_container
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/date_time//boost_date_time
/boost/exception//boost_exception
/boost/function//boost_function
/boost/io//boost_io
/boost/move//boost_move
/boost/optional//boost_optional
/boost/predef//boost_predef
/boost/preprocessor//boost_preprocessor
/boost/smart_ptr//boost_smart_ptr
/boost/static_assert//boost_static_assert
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility
/boost/winapi//boost_winapi ;
project /boost/thread
;
explicit
[ alias boost_thread : build//boost_thread ]
[ alias all : boost_thread example test ]
;
call-if : boost-library thread
: install boost_thread
;

View File

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

View File

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

View File

@@ -4668,7 +4668,7 @@ namespace detail
}
run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT {
if (this != &x) {
that_=x.that;
that_=x.that_;
x.that_.reset();
}
return *this;

View File

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