spinlock.hpp 985 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. //
  8. // boost/detail/spinlock.hpp
  9. //
  10. // Copyright (c) 2008 Peter Dimov
  11. //
  12. // Distributed under the Boost Software License, Version 1.0.
  13. // See accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt)
  15. //
  16. // struct spinlock
  17. // {
  18. // void lock();
  19. // bool try_lock();
  20. // void unlock();
  21. //
  22. // class scoped_lock;
  23. // };
  24. //
  25. // #define BOOST_DETAIL_SPINLOCK_INIT <unspecified>
  26. //
  27. #include <boost/smart_ptr/detail/deprecated_macros.hpp>
  28. #if defined(__clang__)
  29. // Old Clang versions have trouble with ATOMIC_FLAG_INIT
  30. # include <boost/smart_ptr/detail/spinlock_gcc_atomic.hpp>
  31. #else
  32. # include <boost/smart_ptr/detail/spinlock_std_atomic.hpp>
  33. #endif
  34. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_HPP_INCLUDED