summaryrefslogtreecommitdiff
path: root/src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp')
-rw-r--r--src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp b/src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp
deleted file mode 100644
index a264b1a3..00000000
--- a/src/libs/boost-1.37.0/boost/detail/spinlock_pool.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED
-#define BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED
-
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-//
-// boost/detail/spinlock_pool.hpp
-//
-// Copyright (c) 2008 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)
-//
-// spinlock_pool<0> is reserved for atomic<>, when/if it arrives
-// spinlock_pool<1> is reserved for shared_ptr reference counts
-// spinlock_pool<2> is reserved for shared_ptr atomic access
-//
-
-#include <boost/config.hpp>
-#include <boost/detail/spinlock.hpp>
-#include <cstddef>
-
-namespace boost
-{
-
-namespace detail
-{
-
-template< int I > class spinlock_pool
-{
-private:
-
- static spinlock pool_[ 41 ];
-
-public:
-
- static spinlock & spinlock_for( void const * pv )
- {
- std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41;
- return pool_[ i ];
- }
-
- class scoped_lock
- {
- private:
-
- spinlock & sp_;
-
- scoped_lock( scoped_lock const & );
- scoped_lock & operator=( scoped_lock const & );
-
- public:
-
- explicit scoped_lock( void const * pv ): sp_( spinlock_for( pv ) )
- {
- sp_.lock();
- }
-
- ~scoped_lock()
- {
- sp_.unlock();
- }
- };
-};
-
-template< int I > spinlock spinlock_pool< I >::pool_[ 41 ] =
-{
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT,
- BOOST_DETAIL_SPINLOCK_INIT
-};
-
-} // namespace detail
-} // namespace boost
-
-#endif // #ifndef BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED