BVB Source Codes

mars Show memory_order.hpp Source code

Return Download mars: download memory_order.hpp Source code - Download mars Source code - Type:.hpp
  1. #ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED
  2. #define BOOST_MEMORY_ORDER_HPP_INCLUDED
  3.  
  4. // MS compatible compilers support #pragma once
  5.  
  6. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  7. # pragma once
  8. #endif
  9.  
  10. //  boost/memory_order.hpp
  11. //
  12. //  Defines enum mars_boost::memory_order per the C++0x working draft
  13. //
  14. //  Copyright (c) 2008, 2009 Peter Dimov
  15. //
  16. //  Distributed under the Boost Software License, Version 1.0.
  17. //  See accompanying file LICENSE_1_0.txt or copy at
  18. //  http://www.boost.org/LICENSE_1_0.txt)
  19.  
  20.  
  21. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
  22. {
  23.  
  24. //
  25. // Enum values are chosen so that code that needs to insert
  26. // a trailing fence for acquire semantics can use a single
  27. // test such as:
  28. //
  29. // if( mo & memory_order_acquire ) { ...fence... }
  30. //
  31. // For leading fences one can use:
  32. //
  33. // if( mo & memory_order_release ) { ...fence... }
  34. //
  35. // Architectures such as Alpha that need a fence on consume
  36. // can use:
  37. //
  38. // if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... }
  39. //
  40. // The values are also in the order of increasing "strength"
  41. // of the fences so that success/failure orders can be checked
  42. // efficiently in compare_exchange methods.
  43. //
  44.  
  45. enum memory_order
  46. {
  47.     memory_order_relaxed = 0,
  48.     memory_order_consume = 1,
  49.     memory_order_acquire = 2,
  50.     memory_order_release = 4,
  51.     memory_order_acq_rel = 6, // acquire | release
  52.     memory_order_seq_cst = 14 // acq_rel | 8
  53. };
  54.  
  55. } // namespace mars_boost
  56.  
  57. #endif // #ifndef BOOST_MEMORY_ORDER_HPP_INCLUDED
  58.  
downloadmemory_order.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top