atomic.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. Copyright 2005-2015 Intel Corporation. All Rights Reserved.
  3. This file is part of Threading Building Blocks. Threading Building Blocks is free software;
  4. you can redistribute it and/or modify it under the terms of the GNU General Public License
  5. version 2 as published by the Free Software Foundation. Threading Building Blocks is
  6. distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the GNU General Public License for more details. You should have received a copy of
  9. the GNU General Public License along with Threading Building Blocks; if not, write to the
  10. Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  11. As a special exception, you may use this file as part of a free software library without
  12. restriction. Specifically, if other files instantiate templates or use macros or inline
  13. functions from this file, or you compile this file and link it with other files to produce
  14. an executable, this file does not by itself cause the resulting executable to be covered
  15. by the GNU General Public License. This exception does not however invalidate any other
  16. reasons why the executable file might be covered by the GNU General Public License.
  17. */
  18. #ifndef __TBB_atomic_H
  19. #define __TBB_atomic_H
  20. #include <cstddef>
  21. #if _MSC_VER
  22. #define __TBB_LONG_LONG __int64
  23. #else
  24. #define __TBB_LONG_LONG long long
  25. #endif /* _MSC_VER */
  26. #include "tbb_machine.h"
  27. #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
  28. // Workaround for overzealous compiler warnings
  29. #pragma warning (push)
  30. #pragma warning (disable: 4244 4267 4512)
  31. #endif
  32. namespace tbb {
  33. //! Specifies memory semantics.
  34. enum memory_semantics {
  35. //! Sequential consistency
  36. full_fence,
  37. //! Acquire
  38. acquire,
  39. //! Release
  40. release,
  41. //! No ordering
  42. relaxed
  43. };
  44. //! @cond INTERNAL
  45. namespace internal {
  46. #if __TBB_ATTRIBUTE_ALIGNED_PRESENT
  47. #define __TBB_DECL_ATOMIC_FIELD(t,f,a) t f __attribute__ ((aligned(a)));
  48. #elif __TBB_DECLSPEC_ALIGN_PRESENT
  49. #define __TBB_DECL_ATOMIC_FIELD(t,f,a) __declspec(align(a)) t f;
  50. #else
  51. #error Do not know syntax for forcing alignment.
  52. #endif
  53. template<size_t S>
  54. struct atomic_rep; // Primary template declared, but never defined.
  55. template<>
  56. struct atomic_rep<1> { // Specialization
  57. typedef int8_t word;
  58. };
  59. template<>
  60. struct atomic_rep<2> { // Specialization
  61. typedef int16_t word;
  62. };
  63. template<>
  64. struct atomic_rep<4> { // Specialization
  65. #if _MSC_VER && !_WIN64
  66. // Work-around that avoids spurious /Wp64 warnings
  67. typedef intptr_t word;
  68. #else
  69. typedef int32_t word;
  70. #endif
  71. };
  72. #if __TBB_64BIT_ATOMICS
  73. template<>
  74. struct atomic_rep<8> { // Specialization
  75. typedef int64_t word;
  76. };
  77. #endif
  78. template<typename value_type, size_t size>
  79. struct aligned_storage;
  80. //the specializations are needed to please MSVC syntax of __declspec(align()) which accept _literal_ constants only
  81. #if __TBB_ATOMIC_CTORS
  82. #define ATOMIC_STORAGE_PARTIAL_SPECIALIZATION(S) \
  83. template<typename value_type> \
  84. struct aligned_storage<value_type,S> { \
  85. __TBB_DECL_ATOMIC_FIELD(value_type,my_value,S) \
  86. aligned_storage() = default ; \
  87. constexpr aligned_storage(value_type value):my_value(value){} \
  88. }; \
  89. #else
  90. #define ATOMIC_STORAGE_PARTIAL_SPECIALIZATION(S) \
  91. template<typename value_type> \
  92. struct aligned_storage<value_type,S> { \
  93. __TBB_DECL_ATOMIC_FIELD(value_type,my_value,S) \
  94. }; \
  95. #endif
  96. template<typename value_type>
  97. struct aligned_storage<value_type,1> {
  98. value_type my_value;
  99. #if __TBB_ATOMIC_CTORS
  100. aligned_storage() = default ;
  101. constexpr aligned_storage(value_type value):my_value(value){}
  102. #endif
  103. };
  104. ATOMIC_STORAGE_PARTIAL_SPECIALIZATION(2)
  105. ATOMIC_STORAGE_PARTIAL_SPECIALIZATION(4)
  106. #if __TBB_64BIT_ATOMICS
  107. ATOMIC_STORAGE_PARTIAL_SPECIALIZATION(8)
  108. #endif
  109. template<size_t Size, memory_semantics M>
  110. struct atomic_traits; // Primary template declared, but not defined.
  111. #define __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(S,M) \
  112. template<> struct atomic_traits<S,M> { \
  113. typedef atomic_rep<S>::word word; \
  114. inline static word compare_and_swap( volatile void* location, word new_value, word comparand ) { \
  115. return __TBB_machine_cmpswp##S##M(location,new_value,comparand); \
  116. } \
  117. inline static word fetch_and_add( volatile void* location, word addend ) { \
  118. return __TBB_machine_fetchadd##S##M(location,addend); \
  119. } \
  120. inline static word fetch_and_store( volatile void* location, word value ) { \
  121. return __TBB_machine_fetchstore##S##M(location,value); \
  122. } \
  123. };
  124. #define __TBB_DECL_ATOMIC_PRIMITIVES(S) \
  125. template<memory_semantics M> \
  126. struct atomic_traits<S,M> { \
  127. typedef atomic_rep<S>::word word; \
  128. inline static word compare_and_swap( volatile void* location, word new_value, word comparand ) { \
  129. return __TBB_machine_cmpswp##S(location,new_value,comparand); \
  130. } \
  131. inline static word fetch_and_add( volatile void* location, word addend ) { \
  132. return __TBB_machine_fetchadd##S(location,addend); \
  133. } \
  134. inline static word fetch_and_store( volatile void* location, word value ) { \
  135. return __TBB_machine_fetchstore##S(location,value); \
  136. } \
  137. };
  138. template<memory_semantics M>
  139. struct atomic_load_store_traits; // Primary template declaration
  140. #define __TBB_DECL_ATOMIC_LOAD_STORE_PRIMITIVES(M) \
  141. template<> struct atomic_load_store_traits<M> { \
  142. template <typename T> \
  143. inline static T load( const volatile T& location ) { \
  144. return __TBB_load_##M( location ); \
  145. } \
  146. template <typename T> \
  147. inline static void store( volatile T& location, T value ) { \
  148. __TBB_store_##M( location, value ); \
  149. } \
  150. }
  151. #if __TBB_USE_FENCED_ATOMICS
  152. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(1,full_fence)
  153. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(2,full_fence)
  154. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(4,full_fence)
  155. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(1,acquire)
  156. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(2,acquire)
  157. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(4,acquire)
  158. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(1,release)
  159. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(2,release)
  160. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(4,release)
  161. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(1,relaxed)
  162. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(2,relaxed)
  163. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(4,relaxed)
  164. #if __TBB_64BIT_ATOMICS
  165. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(8,full_fence)
  166. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(8,acquire)
  167. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(8,release)
  168. __TBB_DECL_FENCED_ATOMIC_PRIMITIVES(8,relaxed)
  169. #endif
  170. #else /* !__TBB_USE_FENCED_ATOMICS */
  171. __TBB_DECL_ATOMIC_PRIMITIVES(1)
  172. __TBB_DECL_ATOMIC_PRIMITIVES(2)
  173. __TBB_DECL_ATOMIC_PRIMITIVES(4)
  174. #if __TBB_64BIT_ATOMICS
  175. __TBB_DECL_ATOMIC_PRIMITIVES(8)
  176. #endif
  177. #endif /* !__TBB_USE_FENCED_ATOMICS */
  178. __TBB_DECL_ATOMIC_LOAD_STORE_PRIMITIVES(full_fence);
  179. __TBB_DECL_ATOMIC_LOAD_STORE_PRIMITIVES(acquire);
  180. __TBB_DECL_ATOMIC_LOAD_STORE_PRIMITIVES(release);
  181. __TBB_DECL_ATOMIC_LOAD_STORE_PRIMITIVES(relaxed);
  182. //! Additive inverse of 1 for type T.
  183. /** Various compilers issue various warnings if -1 is used with various integer types.
  184. The baroque expression below avoids all the warnings (we hope). */
  185. #define __TBB_MINUS_ONE(T) (T(T(0)-T(1)))
  186. //! Base class that provides basic functionality for atomic<T> without fetch_and_add.
  187. /** Works for any type T that has the same size as an integral type, has a trivial constructor/destructor,
  188. and can be copied/compared by memcpy/memcmp. */
  189. template<typename T>
  190. struct atomic_impl {
  191. protected:
  192. aligned_storage<T,sizeof(T)> my_storage;
  193. private:
  194. //TODO: rechecks on recent versions of gcc if union is still the _only_ way to do a conversion without warnings
  195. //! Union type used to convert type T to underlying integral type.
  196. template<typename value_type>
  197. union converter {
  198. typedef typename atomic_rep<sizeof(value_type)>::word bits_type;
  199. converter(){}
  200. converter(value_type a_value) : value(a_value) {}
  201. value_type value;
  202. bits_type bits;
  203. };
  204. template<typename value_t>
  205. static typename converter<value_t>::bits_type to_bits(value_t value){
  206. return converter<value_t>(value).bits;
  207. }
  208. template<typename value_t>
  209. static value_t to_value(typename converter<value_t>::bits_type bits){
  210. converter<value_t> u;
  211. u.bits = bits;
  212. return u.value;
  213. }
  214. template<typename value_t>
  215. union ptr_converter; //Primary template declared, but never defined.
  216. template<typename value_t>
  217. union ptr_converter<value_t *> {
  218. ptr_converter(){}
  219. ptr_converter(value_t* a_value) : value(a_value) {}
  220. value_t* value;
  221. uintptr_t bits;
  222. };
  223. //TODO: check if making to_bits accepting reference (thus unifying it with to_bits_ref)
  224. //does not hurt performance
  225. template<typename value_t>
  226. static typename converter<value_t>::bits_type & to_bits_ref(value_t& value){
  227. //TODO: this #ifdef is temporary workaround, as union conversion seems to fail
  228. //on suncc for 64 bit types for 32 bit target
  229. #if !__SUNPRO_CC
  230. return *(typename converter<value_t>::bits_type*)ptr_converter<value_t*>(&value).bits;
  231. #else
  232. return *(typename converter<value_t>::bits_type*)(&value);
  233. #endif
  234. }
  235. public:
  236. typedef T value_type;
  237. #if __TBB_ATOMIC_CTORS
  238. atomic_impl() = default ;
  239. constexpr atomic_impl(value_type value):my_storage(value){}
  240. #endif
  241. template<memory_semantics M>
  242. value_type fetch_and_store( value_type value ) {
  243. return to_value<value_type>(
  244. internal::atomic_traits<sizeof(value_type),M>::fetch_and_store( &my_storage.my_value, to_bits(value) )
  245. );
  246. }
  247. value_type fetch_and_store( value_type value ) {
  248. return fetch_and_store<full_fence>(value);
  249. }
  250. template<memory_semantics M>
  251. value_type compare_and_swap( value_type value, value_type comparand ) {
  252. return to_value<value_type>(
  253. internal::atomic_traits<sizeof(value_type),M>::compare_and_swap( &my_storage.my_value, to_bits(value), to_bits(comparand) )
  254. );
  255. }
  256. value_type compare_and_swap( value_type value, value_type comparand ) {
  257. return compare_and_swap<full_fence>(value,comparand);
  258. }
  259. operator value_type() const volatile { // volatile qualifier here for backwards compatibility
  260. return to_value<value_type>(
  261. __TBB_load_with_acquire( to_bits_ref(my_storage.my_value) )
  262. );
  263. }
  264. template<memory_semantics M>
  265. value_type load () const {
  266. return to_value<value_type>(
  267. internal::atomic_load_store_traits<M>::load( to_bits_ref(my_storage.my_value) )
  268. );
  269. }
  270. value_type load () const {
  271. return load<acquire>();
  272. }
  273. template<memory_semantics M>
  274. void store ( value_type value ) {
  275. internal::atomic_load_store_traits<M>::store( to_bits_ref(my_storage.my_value), to_bits(value));
  276. }
  277. void store ( value_type value ) {
  278. store<release>( value );
  279. }
  280. protected:
  281. value_type store_with_release( value_type rhs ) {
  282. //TODO: unify with store<release>
  283. __TBB_store_with_release( to_bits_ref(my_storage.my_value), to_bits(rhs) );
  284. return rhs;
  285. }
  286. };
  287. //! Base class that provides basic functionality for atomic<T> with fetch_and_add.
  288. /** I is the underlying type.
  289. D is the difference type.
  290. StepType should be char if I is an integral type, and T if I is a T*. */
  291. template<typename I, typename D, typename StepType>
  292. struct atomic_impl_with_arithmetic: atomic_impl<I> {
  293. public:
  294. typedef I value_type;
  295. #if __TBB_ATOMIC_CTORS
  296. atomic_impl_with_arithmetic() = default ;
  297. constexpr atomic_impl_with_arithmetic(value_type value): atomic_impl<I>(value){}
  298. #endif
  299. template<memory_semantics M>
  300. value_type fetch_and_add( D addend ) {
  301. return value_type(internal::atomic_traits<sizeof(value_type),M>::fetch_and_add( &this->my_storage.my_value, addend*sizeof(StepType) ));
  302. }
  303. value_type fetch_and_add( D addend ) {
  304. return fetch_and_add<full_fence>(addend);
  305. }
  306. template<memory_semantics M>
  307. value_type fetch_and_increment() {
  308. return fetch_and_add<M>(1);
  309. }
  310. value_type fetch_and_increment() {
  311. return fetch_and_add(1);
  312. }
  313. template<memory_semantics M>
  314. value_type fetch_and_decrement() {
  315. return fetch_and_add<M>(__TBB_MINUS_ONE(D));
  316. }
  317. value_type fetch_and_decrement() {
  318. return fetch_and_add(__TBB_MINUS_ONE(D));
  319. }
  320. public:
  321. value_type operator+=( D value ) {
  322. return fetch_and_add(value)+value;
  323. }
  324. value_type operator-=( D value ) {
  325. // Additive inverse of value computed using binary minus,
  326. // instead of unary minus, for sake of avoiding compiler warnings.
  327. return operator+=(D(0)-value);
  328. }
  329. value_type operator++() {
  330. return fetch_and_add(1)+1;
  331. }
  332. value_type operator--() {
  333. return fetch_and_add(__TBB_MINUS_ONE(D))-1;
  334. }
  335. value_type operator++(int) {
  336. return fetch_and_add(1);
  337. }
  338. value_type operator--(int) {
  339. return fetch_and_add(__TBB_MINUS_ONE(D));
  340. }
  341. };
  342. } /* Internal */
  343. //! @endcond
  344. //! Primary template for atomic.
  345. /** See the Reference for details.
  346. @ingroup synchronization */
  347. template<typename T>
  348. struct atomic: internal::atomic_impl<T> {
  349. #if __TBB_ATOMIC_CTORS
  350. atomic() = default;
  351. constexpr atomic(T arg): internal::atomic_impl<T>(arg) {}
  352. #endif
  353. T operator=( T rhs ) {
  354. // "this" required here in strict ISO C++ because store_with_release is a dependent name
  355. return this->store_with_release(rhs);
  356. }
  357. atomic<T>& operator=( const atomic<T>& rhs ) {this->store_with_release(rhs); return *this;}
  358. };
  359. #if __TBB_ATOMIC_CTORS
  360. #define __TBB_DECL_ATOMIC(T) \
  361. template<> struct atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
  362. atomic() = default; \
  363. constexpr atomic(T arg): internal::atomic_impl_with_arithmetic<T,T,char>(arg) {} \
  364. \
  365. T operator=( T rhs ) {return store_with_release(rhs);} \
  366. atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
  367. };
  368. #else
  369. #define __TBB_DECL_ATOMIC(T) \
  370. template<> struct atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
  371. T operator=( T rhs ) {return store_with_release(rhs);} \
  372. atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
  373. };
  374. #endif
  375. #if __TBB_64BIT_ATOMICS
  376. //TODO: consider adding non-default (and atomic) copy constructor for 32bit platform
  377. __TBB_DECL_ATOMIC(__TBB_LONG_LONG)
  378. __TBB_DECL_ATOMIC(unsigned __TBB_LONG_LONG)
  379. #else
  380. // test_atomic will verify that sizeof(long long)==8
  381. #endif
  382. __TBB_DECL_ATOMIC(long)
  383. __TBB_DECL_ATOMIC(unsigned long)
  384. #if _MSC_VER && !_WIN64
  385. #if __TBB_ATOMIC_CTORS
  386. /* Special version of __TBB_DECL_ATOMIC that avoids gratuitous warnings from cl /Wp64 option.
  387. It is identical to __TBB_DECL_ATOMIC(unsigned) except that it replaces operator=(T)
  388. with an operator=(U) that explicitly converts the U to a T. Types T and U should be
  389. type synonyms on the platform. Type U should be the wider variant of T from the
  390. perspective of /Wp64. */
  391. #define __TBB_DECL_ATOMIC_ALT(T,U) \
  392. template<> struct atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
  393. atomic() = default ; \
  394. constexpr atomic(T arg): internal::atomic_impl_with_arithmetic<T,T,char>(arg) {} \
  395. T operator=( U rhs ) {return store_with_release(T(rhs));} \
  396. atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
  397. };
  398. #else
  399. #define __TBB_DECL_ATOMIC_ALT(T,U) \
  400. template<> struct atomic<T>: internal::atomic_impl_with_arithmetic<T,T,char> { \
  401. T operator=( U rhs ) {return store_with_release(T(rhs));} \
  402. atomic<T>& operator=( const atomic<T>& rhs ) {store_with_release(rhs); return *this;} \
  403. };
  404. #endif
  405. __TBB_DECL_ATOMIC_ALT(unsigned,size_t)
  406. __TBB_DECL_ATOMIC_ALT(int,ptrdiff_t)
  407. #else
  408. __TBB_DECL_ATOMIC(unsigned)
  409. __TBB_DECL_ATOMIC(int)
  410. #endif /* _MSC_VER && !_WIN64 */
  411. __TBB_DECL_ATOMIC(unsigned short)
  412. __TBB_DECL_ATOMIC(short)
  413. __TBB_DECL_ATOMIC(char)
  414. __TBB_DECL_ATOMIC(signed char)
  415. __TBB_DECL_ATOMIC(unsigned char)
  416. #if !_MSC_VER || defined(_NATIVE_WCHAR_T_DEFINED)
  417. __TBB_DECL_ATOMIC(wchar_t)
  418. #endif /* _MSC_VER||!defined(_NATIVE_WCHAR_T_DEFINED) */
  419. //! Specialization for atomic<T*> with arithmetic and operator->.
  420. template<typename T> struct atomic<T*>: internal::atomic_impl_with_arithmetic<T*,ptrdiff_t,T> {
  421. #if __TBB_ATOMIC_CTORS
  422. atomic() = default ;
  423. constexpr atomic(T* arg): internal::atomic_impl_with_arithmetic<T*,ptrdiff_t,T>(arg) {}
  424. #endif
  425. T* operator=( T* rhs ) {
  426. // "this" required here in strict ISO C++ because store_with_release is a dependent name
  427. return this->store_with_release(rhs);
  428. }
  429. atomic<T*>& operator=( const atomic<T*>& rhs ) {
  430. this->store_with_release(rhs); return *this;
  431. }
  432. T* operator->() const {
  433. return (*this);
  434. }
  435. };
  436. //! Specialization for atomic<void*>, for sake of not allowing arithmetic or operator->.
  437. template<> struct atomic<void*>: internal::atomic_impl<void*> {
  438. #if __TBB_ATOMIC_CTORS
  439. atomic() = default ;
  440. constexpr atomic(void* arg): internal::atomic_impl<void*>(arg) {}
  441. #endif
  442. void* operator=( void* rhs ) {
  443. // "this" required here in strict ISO C++ because store_with_release is a dependent name
  444. return this->store_with_release(rhs);
  445. }
  446. atomic<void*>& operator=( const atomic<void*>& rhs ) {
  447. this->store_with_release(rhs); return *this;
  448. }
  449. };
  450. // Helpers to workaround ugly syntax of calling template member function of a
  451. // template class with template argument dependent on template parameters.
  452. template <memory_semantics M, typename T>
  453. T load ( const atomic<T>& a ) { return a.template load<M>(); }
  454. template <memory_semantics M, typename T>
  455. void store ( atomic<T>& a, T value ) { a.template store<M>(value); }
  456. namespace interface6{
  457. //! Make an atomic for use in an initialization (list), as an alternative to zero-initialization or normal assignment.
  458. template<typename T>
  459. atomic<T> make_atomic(T t) {
  460. atomic<T> a;
  461. store<relaxed>(a,t);
  462. return a;
  463. }
  464. }
  465. using interface6::make_atomic;
  466. namespace internal {
  467. template<memory_semantics M, typename T >
  468. void swap(atomic<T> & lhs, atomic<T> & rhs){
  469. T tmp = load<M>(lhs);
  470. store<M>(lhs,load<M>(rhs));
  471. store<M>(rhs,tmp);
  472. }
  473. // only to aid in the gradual conversion of ordinary variables to proper atomics
  474. template<typename T>
  475. inline atomic<T>& as_atomic( T& t ) {
  476. return (atomic<T>&)t;
  477. }
  478. } // namespace tbb::internal
  479. } // namespace tbb
  480. #if _MSC_VER && !__INTEL_COMPILER
  481. #pragma warning (pop)
  482. #endif // warnings 4244, 4267 are back
  483. #endif /* __TBB_atomic_H */