forked from Xeeynamo/sonic-hybrid-rsdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
426 additions
and
0 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...air/build/_xcode/boost.framework/Versions/A/Headers/smart_ptr/detail/atomic_count_gcc.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED | ||
#define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED | ||
|
||
// | ||
// boost/detail/atomic_count_gcc.hpp | ||
// | ||
// atomic_count for GNU libstdc++ v3 | ||
// | ||
// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html | ||
// | ||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. | ||
// Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org> | ||
// Copyright 2003-2005 Peter Dimov | ||
// | ||
// 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) | ||
// | ||
|
||
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 402 | ||
# include <ext/atomicity.h> | ||
#else | ||
# include <bits/atomicity.h> | ||
#endif | ||
|
||
namespace boost | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
#if defined(__GLIBCXX__) // g++ 3.4+ | ||
|
||
using __gnu_cxx::__atomic_add; | ||
using __gnu_cxx::__exchange_and_add; | ||
|
||
#endif | ||
|
||
class atomic_count | ||
{ | ||
public: | ||
|
||
explicit atomic_count( long v ) : value_( v ) {} | ||
|
||
long operator++() | ||
{ | ||
return __exchange_and_add( &value_, +1 ) + 1; | ||
} | ||
|
||
long operator--() | ||
{ | ||
return __exchange_and_add( &value_, -1 ) - 1; | ||
} | ||
|
||
operator long() const | ||
{ | ||
return __exchange_and_add( &value_, 0 ); | ||
} | ||
|
||
private: | ||
|
||
atomic_count(atomic_count const &); | ||
atomic_count & operator=(atomic_count const &); | ||
|
||
mutable _Atomic_word value_; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
} // namespace boost | ||
|
||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED |
77 changes: 77 additions & 0 deletions
77
...build/_xcode/boost.framework/Versions/A/Headers/smart_ptr/detail/atomic_count_gcc_x86.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_X86_HPP_INCLUDED | ||
#define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_X86_HPP_INCLUDED | ||
|
||
// | ||
// boost/detail/atomic_count_gcc_x86.hpp | ||
// | ||
// atomic_count for g++ on 486+/AMD64 | ||
// | ||
// Copyright 2007 Peter Dimov | ||
// | ||
// 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) | ||
// | ||
|
||
namespace boost | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
class atomic_count | ||
{ | ||
public: | ||
|
||
explicit atomic_count( long v ) : value_( static_cast< int >( v ) ) {} | ||
|
||
long operator++() | ||
{ | ||
return atomic_exchange_and_add( &value_, +1 ) + 1; | ||
} | ||
|
||
long operator--() | ||
{ | ||
return atomic_exchange_and_add( &value_, -1 ) - 1; | ||
} | ||
|
||
operator long() const | ||
{ | ||
return atomic_exchange_and_add( &value_, 0 ); | ||
} | ||
|
||
private: | ||
|
||
atomic_count(atomic_count const &); | ||
atomic_count & operator=(atomic_count const &); | ||
|
||
mutable int value_; | ||
|
||
private: | ||
|
||
static int atomic_exchange_and_add( int * pw, int dv ) | ||
{ | ||
// int r = *pw; | ||
// *pw += dv; | ||
// return r; | ||
|
||
int r; | ||
|
||
__asm__ __volatile__ | ||
( | ||
"lock\n\t" | ||
"xadd %1, %0": | ||
"+m"( *pw ), "=r"( r ): // outputs (%0, %1) | ||
"1"( dv ): // inputs (%2 == %1) | ||
"memory", "cc" // clobbers | ||
); | ||
|
||
return r; | ||
} | ||
}; | ||
|
||
} // namespace detail | ||
|
||
} // namespace boost | ||
|
||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_GCC_X86_HPP_INCLUDED |
59 changes: 59 additions & 0 deletions
59
...3air/build/_xcode/boost.framework/Versions/A/Headers/smart_ptr/detail/atomic_count_nt.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_NT_HPP_INCLUDED | ||
#define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_NT_HPP_INCLUDED | ||
|
||
// | ||
// boost/detail/atomic_count_nt.hpp | ||
// | ||
// Trivial atomic_count for the single-threaded case | ||
// | ||
// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html | ||
// | ||
// Copyright 2013 Peter Dimov | ||
// | ||
// 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 | ||
// | ||
|
||
namespace boost | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
class atomic_count | ||
{ | ||
public: | ||
|
||
explicit atomic_count( long v ): value_( v ) | ||
{ | ||
} | ||
|
||
long operator++() | ||
{ | ||
return ++value_; | ||
} | ||
|
||
long operator--() | ||
{ | ||
return --value_; | ||
} | ||
|
||
operator long() const | ||
{ | ||
return value_; | ||
} | ||
|
||
private: | ||
|
||
atomic_count(atomic_count const &); | ||
atomic_count & operator=(atomic_count const &); | ||
|
||
long value_; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
} // namespace boost | ||
|
||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_NT_HPP_INCLUDED |
97 changes: 97 additions & 0 deletions
97
...3air/build/_xcode/boost.framework/Versions/A/Headers/smart_ptr/detail/atomic_count_pt.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED | ||
#define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED | ||
|
||
// | ||
// boost/detail/atomic_count_pthreads.hpp | ||
// | ||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. | ||
// | ||
// 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) | ||
// | ||
|
||
#include <boost/assert.hpp> | ||
#include <pthread.h> | ||
|
||
// | ||
// The generic pthread_mutex-based implementation sometimes leads to | ||
// inefficiencies. Example: a class with two atomic_count members | ||
// can get away with a single mutex. | ||
// | ||
// Users can detect this situation by checking BOOST_AC_USE_PTHREADS. | ||
// | ||
|
||
namespace boost | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
class atomic_count | ||
{ | ||
private: | ||
|
||
class scoped_lock | ||
{ | ||
public: | ||
|
||
scoped_lock(pthread_mutex_t & m): m_(m) | ||
{ | ||
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); | ||
} | ||
|
||
~scoped_lock() | ||
{ | ||
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); | ||
} | ||
|
||
private: | ||
|
||
pthread_mutex_t & m_; | ||
}; | ||
|
||
public: | ||
|
||
explicit atomic_count(long v): value_(v) | ||
{ | ||
BOOST_VERIFY( pthread_mutex_init( &mutex_, 0 ) == 0 ); | ||
} | ||
|
||
~atomic_count() | ||
{ | ||
BOOST_VERIFY( pthread_mutex_destroy( &mutex_ ) == 0 ); | ||
} | ||
|
||
long operator++() | ||
{ | ||
scoped_lock lock(mutex_); | ||
return ++value_; | ||
} | ||
|
||
long operator--() | ||
{ | ||
scoped_lock lock(mutex_); | ||
return --value_; | ||
} | ||
|
||
operator long() const | ||
{ | ||
scoped_lock lock(mutex_); | ||
return value_; | ||
} | ||
|
||
private: | ||
|
||
atomic_count(atomic_count const &); | ||
atomic_count & operator=(atomic_count const &); | ||
|
||
mutable pthread_mutex_t mutex_; | ||
long value_; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
} // namespace boost | ||
|
||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED |
59 changes: 59 additions & 0 deletions
59
...build/_xcode/boost.framework/Versions/A/Headers/smart_ptr/detail/atomic_count_solaris.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED | ||
#define BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED | ||
|
||
// | ||
// boost/detail/atomic_count_solaris.hpp | ||
// based on: boost/detail/atomic_count_win32.hpp | ||
// | ||
// Copyright (c) 2001-2005 Peter Dimov | ||
// Copyright (c) 2006 Michael van der Westhuizen | ||
// | ||
// 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) | ||
// | ||
|
||
#include <atomic.h> | ||
|
||
namespace boost | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
class atomic_count | ||
{ | ||
public: | ||
|
||
explicit atomic_count( uint32_t v ): value_( v ) | ||
{ | ||
} | ||
|
||
long operator++() | ||
{ | ||
return atomic_inc_32_nv( &value_ ); | ||
} | ||
|
||
long operator--() | ||
{ | ||
return atomic_dec_32_nv( &value_ ); | ||
} | ||
|
||
operator uint32_t() const | ||
{ | ||
return static_cast<uint32_t const volatile &>( value_ ); | ||
} | ||
|
||
private: | ||
|
||
atomic_count( atomic_count const & ); | ||
atomic_count & operator=( atomic_count const & ); | ||
|
||
uint32_t value_; | ||
}; | ||
|
||
} // namespace detail | ||
|
||
} // namespace boost | ||
|
||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED |
Oops, something went wrong.