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

Compare commits

..

6 Commits

Author SHA1 Message Date
Peter Dimov
fadb514c71 Merge branch 'win32-clang-tsa-annotations' of https://github.com/Kojoley/thread into feature/pr-386 2023-09-11 16:58:12 +03:00
Peter Dimov
30dcb6dcbc Update ci.yml 2023-09-11 15:58:17 +03:00
Nikita Kniazev
d56f3f25ad Win32 Clang TSA annotations. Fixes #321 2023-04-23 02:03:50 +03:00
Peter Dimov
52b62ee7b0 Update ci.yml 2023-01-01 03:23:17 +02:00
Peter Dimov
78af23ca14 Remove tabs 2022-12-31 20:01:31 +02:00
Peter Dimov
743d19d7d3 Update ci.yml 2022-07-05 21:47:52 +03:00
5 changed files with 48 additions and 25 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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();
}