mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-04 19:51:02 +02:00
Compare commits
14 Commits
boost-1.82
...
feature/wa
Author | SHA1 | Date | |
---|---|---|---|
|
ef0e40bcda | ||
|
4af91d46f1 | ||
|
42dfdc9e51 | ||
|
763c7f56cd | ||
|
029f089a4a | ||
|
66d11714bd | ||
|
ac0381f0b8 | ||
|
13be03abf8 | ||
|
5e7596ef06 | ||
|
ef1651449f | ||
|
b34786c4d4 | ||
|
aacfb25c82 | ||
|
c7349834be | ||
|
414b0a65d9 |
@@ -333,6 +333,14 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
|||||||
"clang-15",
|
"clang-15",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 22.04 Clang 16",
|
||||||
|
"cppalliance/droneubuntu2204:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' },
|
||||||
|
"clang-16",
|
||||||
|
["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"],
|
||||||
|
),
|
||||||
|
|
||||||
macos_pipeline(
|
macos_pipeline(
|
||||||
"MacOS 10.15 Xcode 12.2 UBSAN",
|
"MacOS 10.15 Xcode 12.2 UBSAN",
|
||||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan,
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan,
|
||||||
|
43
.github/workflows/ci.yml
vendored
43
.github/workflows/ci.yml
vendored
@@ -66,6 +66,12 @@ jobs:
|
|||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install: g++-12-multilib
|
install: g++-12-multilib
|
||||||
address-model: 32,64
|
address-model: 32,64
|
||||||
|
- toolset: gcc-13
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:23.04
|
||||||
|
install: g++-13-multilib
|
||||||
|
address-model: 32,64
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "03,11,14"
|
||||||
@@ -119,24 +125,42 @@ jobs:
|
|||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-13
|
compiler: clang++-13
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
install: clang-13
|
install: clang-13
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-14
|
compiler: clang++-14
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
install: clang-14
|
install: clang-14
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-15
|
compiler: clang++-15
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
container: ubuntu:22.04
|
||||||
|
os: ubuntu-latest
|
||||||
install: clang-15
|
install: clang-15
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-16
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:23.04
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-16
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-17
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
container: ubuntu:23.10
|
||||||
|
os: ubuntu-latest
|
||||||
|
install: clang-17
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "03,11,14,17,2a"
|
||||||
os: macos-11
|
os: macos-11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: macos-12
|
os: macos-12
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
os: macos-13
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
container: ${{matrix.container}}
|
container: ${{matrix.container}}
|
||||||
@@ -152,11 +176,13 @@ jobs:
|
|||||||
if: matrix.container
|
if: matrix.container
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get -y install sudo python git g++
|
apt-get -y install sudo python3 git g++
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
run: sudo apt-get -y install ${{matrix.install}}
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install ${{matrix.install}}
|
||||||
|
|
||||||
- name: Setup Boost
|
- name: Setup Boost
|
||||||
run: |
|
run: |
|
||||||
@@ -176,7 +202,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
|
||||||
|
|
||||||
@@ -208,7 +234,7 @@ jobs:
|
|||||||
addrmd: 32,64
|
addrmd: 32,64
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
- toolset: clang-win
|
- toolset: clang-win
|
||||||
cxxstd: "14,17,latest"
|
cxxstd: "14,17,20,latest"
|
||||||
addrmd: 32,64
|
addrmd: 32,64
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
- toolset: gcc
|
- toolset: gcc
|
||||||
@@ -258,6 +284,7 @@ jobs:
|
|||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
- os: macos-11
|
- os: macos-11
|
||||||
- os: macos-12
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
@@ -305,6 +332,7 @@ jobs:
|
|||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
- os: macos-11
|
- os: macos-11
|
||||||
- os: macos-12
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
@@ -362,6 +390,7 @@ jobs:
|
|||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
- os: macos-11
|
- os: macos-11
|
||||||
- os: macos-12
|
- os: macos-12
|
||||||
|
- os: macos-13
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
defined(BOOST_NO_CXX11_NULLPTR) || \
|
defined(BOOST_NO_CXX11_NULLPTR) || \
|
||||||
defined(BOOST_NO_CXX11_SMART_PTR)
|
defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
|
||||||
BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.84.")
|
BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.85.")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -137,7 +137,7 @@ public:
|
|||||||
|
|
||||||
long use_count() const // nothrow
|
long use_count() const // nothrow
|
||||||
{
|
{
|
||||||
return atomic_load( &use_count_ );
|
return static_cast<long>( atomic_load( &use_count_ ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,51 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_pause.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_pause();
|
|
||||||
//
|
|
||||||
// Emits a "pause" instruction.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) && !defined(__c2__)
|
#include <boost/core/yield_primitives.hpp>
|
||||||
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
extern "C" void _mm_pause();
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE _mm_pause();
|
|
||||||
|
|
||||||
#elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
|
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" );
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define BOOST_SP_PAUSE
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_pause()
|
using boost::core::sp_thread_pause;
|
||||||
{
|
|
||||||
BOOST_SP_PAUSE
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#undef BOOST_SP_PAUSE
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
|
||||||
|
@@ -1,104 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_sleep.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_sleep();
|
|
||||||
//
|
|
||||||
// Cease execution for a while to yield to other threads,
|
|
||||||
// as if by calling nanosleep() with an appropriate interval.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using Sleep(1) in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
using boost::core::sp_thread_sleep;
|
||||||
{
|
|
||||||
Sleep( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#elif defined(BOOST_HAS_NANOSLEEP)
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using nanosleep() in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
|
||||||
{
|
|
||||||
// g++ -Wextra warns on {} or {0}
|
|
||||||
struct timespec rqtp = { 0, 0 };
|
|
||||||
|
|
||||||
// POSIX says that timespec has tv_sec and tv_nsec
|
|
||||||
// But it doesn't guarantee order or placement
|
|
||||||
|
|
||||||
rqtp.tv_sec = 0;
|
|
||||||
rqtp.tv_nsec = 1000;
|
|
||||||
|
|
||||||
nanosleep( &rqtp, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sp_thread_yield() in sp_thread_sleep")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_yield.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_sleep()
|
|
||||||
{
|
|
||||||
sp_thread_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
|
||||||
|
@@ -1,100 +1,23 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// Copyright 2023 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_thread_yield.hpp
|
|
||||||
//
|
|
||||||
// inline void bost::detail::sp_thread_yield();
|
|
||||||
//
|
|
||||||
// Gives up the remainder of the time slice,
|
|
||||||
// as if by calling sched_yield().
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/config/pragma_message.hpp>
|
#include <boost/config/header_deprecated.hpp>
|
||||||
|
|
||||||
#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using Sleep(0) in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
using boost::core::sp_thread_yield;
|
||||||
{
|
|
||||||
Sleep( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#elif defined(BOOST_HAS_SCHED_YIELD)
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sched_yield() in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _AIX
|
|
||||||
# include <sched.h>
|
|
||||||
#else
|
|
||||||
// AIX's sched.h defines ::var which sometimes conflicts with Lambda's var
|
|
||||||
extern "C" int sched_yield(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
|
||||||
{
|
|
||||||
sched_yield();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
|
|
||||||
BOOST_PRAGMA_MESSAGE("Using sp_thread_pause() in sp_thread_yield")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
inline void sp_thread_yield()
|
|
||||||
{
|
|
||||||
sp_thread_pause();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
|
||||||
|
@@ -1,49 +0,0 @@
|
|||||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
||||||
#define BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// boost/smart_ptr/detail/sp_win32_sleep.hpp
|
|
||||||
//
|
|
||||||
// Declares the Win32 Sleep() function.
|
|
||||||
//
|
|
||||||
// Copyright 2008, 2020 Peter Dimov
|
|
||||||
// Distributed under the Boost Software License, Version 1.0
|
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
#if defined( BOOST_USE_WINDOWS_H )
|
|
||||||
# include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
#if !defined( BOOST_USE_WINDOWS_H )
|
|
||||||
|
|
||||||
#if defined(__clang__) && defined(__x86_64__)
|
|
||||||
// clang x64 warns that __stdcall is ignored
|
|
||||||
# define BOOST_SP_STDCALL
|
|
||||||
#else
|
|
||||||
# define BOOST_SP_STDCALL __stdcall
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__LP64__) // Cygwin 64
|
|
||||||
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned int ms );
|
|
||||||
#else
|
|
||||||
extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned long ms );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef BOOST_SP_STDCALL
|
|
||||||
|
|
||||||
#endif // !defined( BOOST_USE_WINDOWS_H )
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
|
|
@@ -19,9 +19,7 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
|
#include <boost/core/yield_primitives.hpp>
|
||||||
#include <boost/smart_ptr/detail/sp_thread_sleep.hpp>
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@@ -34,13 +32,13 @@ inline void yield( unsigned k )
|
|||||||
// Experiments on Windows and Fedora 32 show that a single pause,
|
// Experiments on Windows and Fedora 32 show that a single pause,
|
||||||
// followed by an immediate sp_thread_sleep(), is best.
|
// followed by an immediate sp_thread_sleep(), is best.
|
||||||
|
|
||||||
if( k == 0 )
|
if( k & 1 )
|
||||||
{
|
{
|
||||||
sp_thread_pause();
|
boost::core::sp_thread_sleep();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sp_thread_sleep();
|
boost::core::sp_thread_pause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -247,17 +247,6 @@ template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const
|
|||||||
return a != b.get();
|
return a != b.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
|
||||||
|
|
||||||
// Resolve the ambiguity between our op!= and the one in rel_ops
|
|
||||||
|
|
||||||
template<class T> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
||||||
{
|
|
||||||
return a.get() != b.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||||
|
|
||||||
template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
|
@@ -895,17 +895,6 @@ template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, share
|
|||||||
return a.get() != b.get();
|
return a.get() != b.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
|
||||||
|
|
||||||
// Resolve the ambiguity between our op!= and the one in rel_ops
|
|
||||||
|
|
||||||
template<class T> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<T> const & b) BOOST_SP_NOEXCEPT
|
|
||||||
{
|
|
||||||
return a.get() != b.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||||
|
|
||||||
template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
template<class T> inline bool operator==( shared_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
|
27
test/Jamfile
27
test/Jamfile
@@ -8,6 +8,7 @@
|
|||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
import ../../config/checks/config : requires ;
|
||||||
|
|
||||||
project
|
project
|
||||||
: requirements
|
: requirements
|
||||||
@@ -16,6 +17,8 @@ project
|
|||||||
#<toolset>gcc:<cxxflags>-Wno-delete-non-virtual-dtor (not in 4.4/4.6)
|
#<toolset>gcc:<cxxflags>-Wno-delete-non-virtual-dtor (not in 4.4/4.6)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
local cnhash = [ requires cxx11_decltype cxx11_noexcept ] <toolset>gcc-4.6:<build>no ;
|
||||||
|
|
||||||
# quick test (for CI)
|
# quick test (for CI)
|
||||||
run quick.cpp ;
|
run quick.cpp ;
|
||||||
|
|
||||||
@@ -92,9 +95,11 @@ compile-fail auto_ptr_lv_fail.cpp
|
|||||||
run atomic_count_test2.cpp ;
|
run atomic_count_test2.cpp ;
|
||||||
run sp_typeinfo_test.cpp ;
|
run sp_typeinfo_test.cpp ;
|
||||||
compile make_shared_fp_test.cpp ;
|
compile make_shared_fp_test.cpp ;
|
||||||
run sp_hash_test.cpp ;
|
run sp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run get_deleter_array_test.cpp ;
|
run get_deleter_array_test.cpp ;
|
||||||
run ip_hash_test.cpp ;
|
run ip_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run owner_less_test.cpp ;
|
run owner_less_test.cpp ;
|
||||||
run sp_unique_ptr_test.cpp ;
|
run sp_unique_ptr_test.cpp ;
|
||||||
run sp_array_test.cpp ;
|
run sp_array_test.cpp ;
|
||||||
@@ -221,8 +226,10 @@ run weak_from_this_test2.cpp ;
|
|||||||
|
|
||||||
run sp_bml_unique_ptr_test.cpp ;
|
run sp_bml_unique_ptr_test.cpp ;
|
||||||
|
|
||||||
run sp_hash_test2.cpp ;
|
run sp_hash_test2.cpp
|
||||||
run sp_hash_test3.cpp ;
|
: : : $(cnhash) ;
|
||||||
|
run sp_hash_test3.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
|
|
||||||
run pointer_cast_test2.cpp ;
|
run pointer_cast_test2.cpp ;
|
||||||
|
|
||||||
@@ -368,11 +375,16 @@ compile-fail shared_from_fail.cpp ;
|
|||||||
compile-fail weak_from_fail.cpp ;
|
compile-fail weak_from_fail.cpp ;
|
||||||
|
|
||||||
compile sp_override_test.cpp ;
|
compile sp_override_test.cpp ;
|
||||||
|
|
||||||
|
local gcc-flags = -Wundef ;
|
||||||
|
|
||||||
compile sp_pedantic_test.cpp
|
compile sp_pedantic_test.cpp
|
||||||
: <warnings>pedantic
|
: <warnings>pedantic
|
||||||
<toolset>msvc:<warnings-as-errors>on
|
<toolset>msvc:<warnings-as-errors>on
|
||||||
<toolset>gcc:<warnings-as-errors>on
|
<toolset>gcc:<warnings-as-errors>on
|
||||||
|
<toolset>gcc:<cxxflags>$(gcc-flags)
|
||||||
<toolset>clang:<warnings-as-errors>on
|
<toolset>clang:<warnings-as-errors>on
|
||||||
|
<toolset>clang:<cxxflags>$(gcc-flags)
|
||||||
<toolset>clang-15:<cxxflags>-Wno-deprecated-builtins
|
<toolset>clang-15:<cxxflags>-Wno-deprecated-builtins
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -388,7 +400,9 @@ run owner_less_test2.cpp ;
|
|||||||
|
|
||||||
run ip_hash_test2.cpp ;
|
run ip_hash_test2.cpp ;
|
||||||
run sp_hash_test4.cpp ;
|
run sp_hash_test4.cpp ;
|
||||||
run lsp_hash_test.cpp ;
|
|
||||||
|
run lsp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run lsp_hash_test2.cpp ;
|
run lsp_hash_test2.cpp ;
|
||||||
|
|
||||||
run atomic_count_mt_test.cpp
|
run atomic_count_mt_test.cpp
|
||||||
@@ -410,7 +424,8 @@ compile sp_report_implementation.cpp ;
|
|||||||
|
|
||||||
run sp_owner_hash_value_test.cpp ;
|
run sp_owner_hash_value_test.cpp ;
|
||||||
|
|
||||||
run wp_hash_test.cpp ;
|
run wp_hash_test.cpp
|
||||||
|
: : : $(cnhash) ;
|
||||||
run wp_hash_test2.cpp ;
|
run wp_hash_test2.cpp ;
|
||||||
|
|
||||||
run wp_unordered_test.cpp ;
|
run wp_unordered_test.cpp ;
|
||||||
|
Reference in New Issue
Block a user