mirror of
https://github.com/boostorg/thread.git
synced 2026-02-15 01:22:08 +00:00
Compare commits
8 Commits
feature/is
...
feature/pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09f01fbb05 | ||
|
|
30dcb6dcbc | ||
|
|
27cb703930 | ||
|
|
52b62ee7b0 | ||
|
|
78af23ca14 | ||
|
|
743d19d7d3 | ||
|
|
7f7faf234d | ||
|
|
4bc126fc37 |
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -18,35 +18,58 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- toolset: gcc-4.8
|
- toolset: gcc-4.8
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
|
cxxstd: 11
|
||||||
install: g++-4.8
|
install: g++-4.8
|
||||||
- toolset: gcc-5
|
- toolset: gcc-5
|
||||||
cxxstd: 11
|
cxxstd: 11
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install: g++-5
|
install: g++-5
|
||||||
- toolset: gcc-7
|
- toolset: gcc-7
|
||||||
os: ubuntu-18.04
|
os: ubuntu-20.04
|
||||||
|
install: g++-7
|
||||||
- toolset: gcc-9
|
- toolset: gcc-9
|
||||||
os: ubuntu-20.04
|
os: ubuntu-20.04
|
||||||
- toolset: gcc-11
|
- toolset: gcc-11
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install: g++-11
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-15
|
||||||
cxxstd: 20
|
cxxstd: 20
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install: clang-12
|
install: clang-15
|
||||||
- toolset: clang
|
- 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}}
|
runs-on: ${{matrix.os}}
|
||||||
|
container: ${{matrix.container}}
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
steps:
|
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
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
run: sudo apt install ${{matrix.install}}
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
run: |
|
run: |
|
||||||
@@ -66,7 +89,7 @@ jobs:
|
|||||||
cd boost-root
|
cd boost-root
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||||
git submodule update --init tools/boostdep
|
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
|
./bootstrap.sh
|
||||||
./b2 -d0 headers
|
./b2 -d0 headers
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/core/swap.hpp>
|
#include <boost/core/invoke_swap.hpp>
|
||||||
|
|
||||||
#include <boost/config/abi_prefix.hpp>
|
#include <boost/config/abi_prefix.hpp>
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ namespace boost
|
|||||||
|
|
||||||
void swap(externally_locked& rhs) //BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR)
|
void swap(externally_locked& rhs) //BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR)
|
||||||
{
|
{
|
||||||
swap(obj_, rhs.obj_);
|
boost::core::invoke_swap(obj_, rhs.obj_);
|
||||||
swap(mtx_, rhs.mtx_);
|
boost::core::invoke_swap(mtx_, rhs.mtx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -245,8 +245,8 @@ namespace boost
|
|||||||
|
|
||||||
void swap(externally_locked& rhs) BOOST_NOEXCEPT
|
void swap(externally_locked& rhs) BOOST_NOEXCEPT
|
||||||
{
|
{
|
||||||
swap(obj_, rhs.obj_);
|
boost::core::invoke_swap(obj_, rhs.obj_);
|
||||||
swap(mtx_, rhs.mtx_);
|
boost::core::invoke_swap(mtx_, rhs.mtx_);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Requires: The lk parameter must be locking the associated mtx.
|
* Requires: The lk parameter must be locking the associated mtx.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <boost/thread/lock_algorithms.hpp>
|
#include <boost/thread/lock_algorithms.hpp>
|
||||||
#include <boost/thread/lock_factories.hpp>
|
#include <boost/thread/lock_factories.hpp>
|
||||||
#include <boost/thread/strict_lock.hpp>
|
#include <boost/thread/strict_lock.hpp>
|
||||||
#include <boost/core/swap.hpp>
|
#include <boost/core/invoke_swap.hpp>
|
||||||
#include <boost/utility/declval.hpp>
|
#include <boost/utility/declval.hpp>
|
||||||
//#include <boost/type_traits.hpp>
|
//#include <boost/type_traits.hpp>
|
||||||
//#include <boost/thread/detail/is_nothrow_default_constructible.hpp>
|
//#include <boost/thread/detail/is_nothrow_default_constructible.hpp>
|
||||||
@@ -582,7 +582,7 @@ namespace boost
|
|||||||
unique_lock<mutex_type> lk1(mtx_, defer_lock);
|
unique_lock<mutex_type> lk1(mtx_, defer_lock);
|
||||||
unique_lock<mutex_type> lk2(rhs.mtx_, defer_lock);
|
unique_lock<mutex_type> lk2(rhs.mtx_, defer_lock);
|
||||||
lock(lk1,lk2);
|
lock(lk1,lk2);
|
||||||
boost::swap(value_, rhs.value_);
|
boost::core::invoke_swap(value_, rhs.value_);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Swap with the underlying value type
|
* Swap with the underlying value type
|
||||||
@@ -592,7 +592,7 @@ namespace boost
|
|||||||
void swap(value_type & rhs)
|
void swap(value_type & rhs)
|
||||||
{
|
{
|
||||||
strict_lock<mutex_type> lk(mtx_);
|
strict_lock<mutex_type> lk(mtx_);
|
||||||
boost::swap(value_, rhs);
|
boost::core::invoke_swap(value_, rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ struct get_tick_count64_state
|
|||||||
BOOST_ALIGNMENT(64) static get_tick_count64_state g_state;
|
BOOST_ALIGNMENT(64) static get_tick_count64_state g_state;
|
||||||
|
|
||||||
//! Artifical implementation of GetTickCount64
|
//! 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);
|
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
|
//! 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();
|
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");
|
boost::winapi::HMODULE_ hKernel32 = boost::winapi::GetModuleHandleW(L"kernel32.dll");
|
||||||
if (hKernel32)
|
if (hKernel32)
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ static void double_interrupt()
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
BOOST_TEST( true ); // perform lwt initialization
|
BOOST_TEST( true ); // perform lwt initialization
|
||||||
|
|
||||||
std::cout << "Start" << std::endl;
|
std::cout << "Start" << std::endl;
|
||||||
double_interrupt();
|
double_interrupt();
|
||||||
std::cout << "End" << std::endl;
|
std::cout << "End" << std::endl;
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ static void double_interrupt()
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
BOOST_TEST( true ); // perform lwt initialization
|
BOOST_TEST( true ); // perform lwt initialization
|
||||||
|
|
||||||
std::cout << "Start" << std::endl;
|
std::cout << "Start" << std::endl;
|
||||||
double_interrupt();
|
double_interrupt();
|
||||||
std::cout << "End" << std::endl;
|
std::cout << "End" << std::endl;
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ static void double_interrupt()
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
BOOST_TEST( true ); // perform lwt initialization
|
BOOST_TEST( true ); // perform lwt initialization
|
||||||
|
|
||||||
std::cout << "Start" << std::endl;
|
std::cout << "Start" << std::endl;
|
||||||
double_interrupt();
|
double_interrupt();
|
||||||
std::cout << "End" << std::endl;
|
std::cout << "End" << std::endl;
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user