cas32strong.hpp
Go to the documentation of this file.
1 #ifndef BOOST_DETAIL_ATOMIC_CAS32STRONG_HPP
2 #define BOOST_DETAIL_ATOMIC_CAS32STRONG_HPP
3 
4 // Distributed under the Boost Software License, Version 1.0.
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // Copyright (c) 2011 Helge Bahmann
9 
10 // Build 8-, 16- and 32-bit atomic operations from
11 // a platform_cmpxchg32_strong primitive.
12 
13 #include <boost/memory_order.hpp>
15 
16 namespace boost {
17 namespace detail {
18 namespace atomic {
19 
20 /* integral types */
21 
22 template<typename T, bool Sign>
23 class base_atomic<T, int, 1, Sign> {
25  typedef T value_type;
26  typedef T difference_type;
27  typedef uint32_t storage_type;
28 public:
29  explicit base_atomic(value_type v) : v_(v) {}
30  base_atomic(void) {}
31 
32  void
33  store(value_type v, memory_order order = memory_order_seq_cst) volatile
34  {
36  const_cast<volatile storage_type &>(v_) = v;
38  }
39 
40  value_type
41  load(memory_order order = memory_order_seq_cst) const volatile
42  {
43  value_type v = const_cast<const volatile storage_type &>(v_);
45  return v;
46  }
47 
48  value_type
49  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
50  {
51  value_type original = load(memory_order_relaxed);
52  do {
53  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
54  return original;
55  }
56 
57  bool
59  value_type & expected,
60  value_type desired,
61  memory_order success_order,
62  memory_order failure_order) volatile
63  {
64  return compare_exchange_strong(expected, desired, success_order, failure_order);
65  }
66 
67  bool
69  value_type & expected,
70  value_type desired,
71  memory_order success_order,
72  memory_order failure_order) volatile
73  {
74  platform_fence_before(success_order);
75 
76  storage_type expected_s = (storage_type) expected;
77  storage_type desired_s = (storage_type) desired;
78 
79  bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
80 
81  if (success) {
82  platform_fence_after(success_order);
83  } else {
84  platform_fence_after(failure_order);
85  expected = (value_type) expected_s;
86  }
87 
88  return success;
89  }
90 
91  value_type
92  fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
93  {
94  value_type original = load(memory_order_relaxed);
95  do {
96  } while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
97  return original;
98  }
99 
100  value_type
101  fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
102  {
103  value_type original = load(memory_order_relaxed);
104  do {
105  } while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
106  return original;
107  }
108 
109  value_type
110  fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
111  {
112  value_type original = load(memory_order_relaxed);
113  do {
114  } while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
115  return original;
116  }
117 
118  value_type
119  fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
120  {
121  value_type original = load(memory_order_relaxed);
122  do {
123  } while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
124  return original;
125  }
126 
127  value_type
128  fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
129  {
130  value_type original = load(memory_order_relaxed);
131  do {
132  } while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
133  return original;
134  }
135 
136  bool
137  is_lock_free(void) const volatile
138  {
139  return true;
140  }
141 
143 private:
144  base_atomic(const base_atomic &) /* = delete */ ;
145  void operator=(const base_atomic &) /* = delete */ ;
146  storage_type v_;
147 };
148 
149 template<typename T, bool Sign>
150 class base_atomic<T, int, 2, Sign> {
152  typedef T value_type;
153  typedef T difference_type;
154  typedef uint32_t storage_type;
155 public:
156  explicit base_atomic(value_type v) : v_(v) {}
157  base_atomic(void) {}
158 
159  void
160  store(value_type v, memory_order order = memory_order_seq_cst) volatile
161  {
163  const_cast<volatile storage_type &>(v_) = v;
165  }
166 
167  value_type
168  load(memory_order order = memory_order_seq_cst) const volatile
169  {
170  value_type v = const_cast<const volatile storage_type &>(v_);
172  return v;
173  }
174 
175  value_type
176  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
177  {
178  value_type original = load(memory_order_relaxed);
179  do {
180  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
181  return original;
182  }
183 
184  bool
186  value_type & expected,
187  value_type desired,
188  memory_order success_order,
189  memory_order failure_order) volatile
190  {
191  return compare_exchange_strong(expected, desired, success_order, failure_order);
192  }
193 
194  bool
196  value_type & expected,
197  value_type desired,
198  memory_order success_order,
199  memory_order failure_order) volatile
200  {
201  platform_fence_before(success_order);
202 
203  storage_type expected_s = (storage_type) expected;
204  storage_type desired_s = (storage_type) desired;
205 
206  bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
207 
208  if (success) {
209  platform_fence_after(success_order);
210  } else {
211  platform_fence_after(failure_order);
212  expected = (value_type) expected_s;
213  }
214 
215  return success;
216  }
217 
218  value_type
219  fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
220  {
221  value_type original = load(memory_order_relaxed);
222  do {
223  } while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
224  return original;
225  }
226 
227  value_type
228  fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
229  {
230  value_type original = load(memory_order_relaxed);
231  do {
232  } while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
233  return original;
234  }
235 
236  value_type
237  fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
238  {
239  value_type original = load(memory_order_relaxed);
240  do {
241  } while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
242  return original;
243  }
244 
245  value_type
246  fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
247  {
248  value_type original = load(memory_order_relaxed);
249  do {
250  } while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
251  return original;
252  }
253 
254  value_type
255  fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
256  {
257  value_type original = load(memory_order_relaxed);
258  do {
259  } while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
260  return original;
261  }
262 
263  bool
264  is_lock_free(void) const volatile
265  {
266  return true;
267  }
268 
270 private:
271  base_atomic(const base_atomic &) /* = delete */ ;
272  void operator=(const base_atomic &) /* = delete */ ;
273  storage_type v_;
274 };
275 
276 template<typename T, bool Sign>
277 class base_atomic<T, int, 4, Sign> {
279  typedef T value_type;
280  typedef T difference_type;
281 public:
282  explicit base_atomic(value_type v) : v_(v) {}
283  base_atomic(void) {}
284 
285  void
286  store(value_type v, memory_order order = memory_order_seq_cst) volatile
287  {
289  const_cast<volatile value_type &>(v_) = v;
291  }
292 
293  value_type
294  load(memory_order order = memory_order_seq_cst) const volatile
295  {
296  value_type v = const_cast<const volatile value_type &>(v_);
298  return v;
299  }
300 
301  value_type
302  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
303  {
304  value_type original = load(memory_order_relaxed);
305  do {
306  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
307  return original;
308  }
309 
310  bool
312  value_type & expected,
313  value_type desired,
314  memory_order success_order,
315  memory_order failure_order) volatile
316  {
317  return compare_exchange_strong(expected, desired, success_order, failure_order);
318  }
319 
320  bool
322  value_type & expected,
323  value_type desired,
324  memory_order success_order,
325  memory_order failure_order) volatile
326  {
327  platform_fence_before(success_order);
328 
329  bool success = platform_cmpxchg32_strong(expected, desired, &v_);
330 
331  if (success) {
332  platform_fence_after(success_order);
333  } else {
334  platform_fence_after(failure_order);
335  }
336 
337  return success;
338  }
339 
340  value_type
341  fetch_add(value_type v, memory_order order = memory_order_seq_cst) volatile
342  {
343  value_type original = load(memory_order_relaxed);
344  do {
345  } while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
346  return original;
347  }
348 
349  value_type
350  fetch_sub(value_type v, memory_order order = memory_order_seq_cst) volatile
351  {
352  value_type original = load(memory_order_relaxed);
353  do {
354  } while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
355  return original;
356  }
357 
358  value_type
359  fetch_and(value_type v, memory_order order = memory_order_seq_cst) volatile
360  {
361  value_type original = load(memory_order_relaxed);
362  do {
363  } while (!compare_exchange_weak(original, original & v, order, memory_order_relaxed));
364  return original;
365  }
366 
367  value_type
368  fetch_or(value_type v, memory_order order = memory_order_seq_cst) volatile
369  {
370  value_type original = load(memory_order_relaxed);
371  do {
372  } while (!compare_exchange_weak(original, original | v, order, memory_order_relaxed));
373  return original;
374  }
375 
376  value_type
377  fetch_xor(value_type v, memory_order order = memory_order_seq_cst) volatile
378  {
379  value_type original = load(memory_order_relaxed);
380  do {
381  } while (!compare_exchange_weak(original, original ^ v, order, memory_order_relaxed));
382  return original;
383  }
384 
385  bool
386  is_lock_free(void) const volatile
387  {
388  return true;
389  }
390 
392 private:
393  base_atomic(const base_atomic &) /* = delete */ ;
394  void operator=(const base_atomic &) /* = delete */ ;
395  value_type v_;
396 };
397 
398 /* pointer types */
399 
400 template<bool Sign>
401 class base_atomic<void *, void *, 4, Sign> {
403  typedef void * value_type;
404  typedef ptrdiff_t difference_type;
405 public:
406  explicit base_atomic(value_type v) : v_(v) {}
407  base_atomic(void) {}
408 
409  void
410  store(value_type v, memory_order order = memory_order_seq_cst) volatile
411  {
413  const_cast<volatile value_type &>(v_) = v;
415  }
416 
417  value_type
418  load(memory_order order = memory_order_seq_cst) const volatile
419  {
420  value_type v = const_cast<const volatile value_type &>(v_);
422  return v;
423  }
424 
425  value_type
426  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
427  {
428  value_type original = load(memory_order_relaxed);
429  do {
430  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
431  return original;
432  }
433 
434  bool
436  value_type & expected,
437  value_type desired,
438  memory_order success_order,
439  memory_order failure_order) volatile
440  {
441  return compare_exchange_strong(expected, desired, success_order, failure_order);
442  }
443 
444  bool
446  value_type & expected,
447  value_type desired,
448  memory_order success_order,
449  memory_order failure_order) volatile
450  {
451  platform_fence_before(success_order);
452 
453  bool success = platform_cmpxchg32_strong(expected, desired, &v_);
454 
455  if (success) {
456  platform_fence_after(success_order);
457  } else {
458  platform_fence_after(failure_order);
459  }
460 
461  return success;
462  }
463 
464  value_type
465  fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
466  {
467  value_type original = load(memory_order_relaxed);
468  do {
469  } while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
470  return original;
471  }
472 
473  value_type
474  fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
475  {
476  value_type original = load(memory_order_relaxed);
477  do {
478  } while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
479  return original;
480  }
481 
482  bool
483  is_lock_free(void) const volatile
484  {
485  return true;
486  }
487 
489 private:
490  base_atomic(const base_atomic &) /* = delete */ ;
491  void operator=(const base_atomic &) /* = delete */ ;
492  value_type v_;
493 };
494 
495 template<typename T, bool Sign>
496 class base_atomic<T *, void *, 4, Sign> {
498  typedef T * value_type;
499  typedef ptrdiff_t difference_type;
500 public:
501  explicit base_atomic(value_type v) : v_(v) {}
502  base_atomic(void) {}
503 
504  void
505  store(value_type v, memory_order order = memory_order_seq_cst) volatile
506  {
508  const_cast<volatile value_type &>(v_) = v;
510  }
511 
512  value_type
513  load(memory_order order = memory_order_seq_cst) const volatile
514  {
515  value_type v = const_cast<const volatile value_type &>(v_);
517  return v;
518  }
519 
520  value_type
521  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
522  {
523  value_type original = load(memory_order_relaxed);
524  do {
525  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
526  return original;
527  }
528 
529  bool
531  value_type & expected,
532  value_type desired,
533  memory_order success_order,
534  memory_order failure_order) volatile
535  {
536  return compare_exchange_strong(expected, desired, success_order, failure_order);
537  }
538 
539  bool
541  value_type & expected,
542  value_type desired,
543  memory_order success_order,
544  memory_order failure_order) volatile
545  {
546  platform_fence_before(success_order);
547 
548  bool success = platform_cmpxchg32_strong(expected, desired, &v_);
549 
550  if (success) {
551  platform_fence_after(success_order);
552  } else {
553  platform_fence_after(failure_order);
554  }
555 
556  return success;
557  }
558 
559  value_type
560  fetch_add(difference_type v, memory_order order = memory_order_seq_cst) volatile
561  {
562  value_type original = load(memory_order_relaxed);
563  do {
564  } while (!compare_exchange_weak(original, original + v, order, memory_order_relaxed));
565  return original;
566  }
567 
568  value_type
569  fetch_sub(difference_type v, memory_order order = memory_order_seq_cst) volatile
570  {
571  value_type original = load(memory_order_relaxed);
572  do {
573  } while (!compare_exchange_weak(original, original - v, order, memory_order_relaxed));
574  return original;
575  }
576 
577  bool
578  is_lock_free(void) const volatile
579  {
580  return true;
581  }
582 
584 private:
585  base_atomic(const base_atomic &) /* = delete */ ;
586  void operator=(const base_atomic &) /* = delete */ ;
587  value_type v_;
588 };
589 
590 /* generic types */
591 
592 template<typename T, bool Sign>
593 class base_atomic<T, void, 1, Sign> {
595  typedef T value_type;
596  typedef uint32_t storage_type;
597 public:
598  explicit base_atomic(value_type v) : v_(0)
599  {
600  memcpy(&v_, &v, sizeof(value_type));
601  }
602  base_atomic(void) : v_(0) {}
603 
604  void
605  store(value_type v, memory_order order = memory_order_seq_cst) volatile
606  {
607  storage_type tmp = 0;
608  memcpy(&tmp, &v, sizeof(value_type));
610  const_cast<volatile storage_type &>(v_) = tmp;
612  }
613 
614  value_type
615  load(memory_order order = memory_order_seq_cst) const volatile
616  {
617  storage_type tmp = const_cast<const volatile storage_type &>(v_);
619 
620  value_type v;
621  memcpy(&v, &tmp, sizeof(value_type));
622  return v;
623  }
624 
625  value_type
626  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
627  {
628  value_type original = load(memory_order_relaxed);
629  do {
630  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
631  return original;
632  }
633 
634  bool
636  value_type & expected,
637  value_type desired,
638  memory_order success_order,
639  memory_order failure_order) volatile
640  {
641  return compare_exchange_strong(expected, desired, success_order, failure_order);
642  }
643 
644  bool
646  value_type & expected,
647  value_type desired,
648  memory_order success_order,
649  memory_order failure_order) volatile
650  {
651 
652  storage_type expected_s = 0, desired_s = 0;
653  memcpy(&expected_s, &expected, sizeof(value_type));
654  memcpy(&desired_s, &desired, sizeof(value_type));
655 
656  platform_fence_before(success_order);
657  bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
658 
659  if (success) {
660  platform_fence_after(success_order);
661  } else {
662  platform_fence_after(failure_order);
663  memcpy(&expected, &expected_s, sizeof(value_type));
664  }
665 
666  return success;
667  }
668 
669  bool
670  is_lock_free(void) const volatile
671  {
672  return true;
673  }
674 
676 private:
677  base_atomic(const base_atomic &) /* = delete */ ;
678  void operator=(const base_atomic &) /* = delete */ ;
679  storage_type v_;
680 };
681 
682 template<typename T, bool Sign>
683 class base_atomic<T, void, 2, Sign> {
685  typedef T value_type;
686  typedef uint32_t storage_type;
687 public:
688  explicit base_atomic(value_type v) : v_(0)
689  {
690  memcpy(&v_, &v, sizeof(value_type));
691  }
692  base_atomic(void) : v_(0) {}
693 
694  void
695  store(value_type v, memory_order order = memory_order_seq_cst) volatile
696  {
697  storage_type tmp = 0;
698  memcpy(&tmp, &v, sizeof(value_type));
700  const_cast<volatile storage_type &>(v_) = tmp;
702  }
703 
704  value_type
705  load(memory_order order = memory_order_seq_cst) const volatile
706  {
707  storage_type tmp = const_cast<const volatile storage_type &>(v_);
709 
710  value_type v;
711  memcpy(&v, &tmp, sizeof(value_type));
712  return v;
713  }
714 
715  value_type
716  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
717  {
718  value_type original = load(memory_order_relaxed);
719  do {
720  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
721  return original;
722  }
723 
724  bool
726  value_type & expected,
727  value_type desired,
728  memory_order success_order,
729  memory_order failure_order) volatile
730  {
731  return compare_exchange_strong(expected, desired, success_order, failure_order);
732  }
733 
734  bool
736  value_type & expected,
737  value_type desired,
738  memory_order success_order,
739  memory_order failure_order) volatile
740  {
741 
742  storage_type expected_s = 0, desired_s = 0;
743  memcpy(&expected_s, &expected, sizeof(value_type));
744  memcpy(&desired_s, &desired, sizeof(value_type));
745 
746  platform_fence_before(success_order);
747  bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
748 
749  if (success) {
750  platform_fence_after(success_order);
751  } else {
752  platform_fence_after(failure_order);
753  memcpy(&expected, &expected_s, sizeof(value_type));
754  }
755 
756  return success;
757  }
758 
759  bool
760  is_lock_free(void) const volatile
761  {
762  return true;
763  }
764 
766 private:
767  base_atomic(const base_atomic &) /* = delete */ ;
768  void operator=(const base_atomic &) /* = delete */ ;
769  storage_type v_;
770 };
771 
772 template<typename T, bool Sign>
773 class base_atomic<T, void, 4, Sign> {
775  typedef T value_type;
776  typedef uint32_t storage_type;
777 public:
778  explicit base_atomic(value_type v) : v_(0)
779  {
780  memcpy(&v_, &v, sizeof(value_type));
781  }
782  base_atomic(void) : v_(0) {}
783 
784  void
785  store(value_type v, memory_order order = memory_order_seq_cst) volatile
786  {
787  storage_type tmp = 0;
788  memcpy(&tmp, &v, sizeof(value_type));
790  const_cast<volatile storage_type &>(v_) = tmp;
792  }
793 
794  value_type
795  load(memory_order order = memory_order_seq_cst) const volatile
796  {
797  storage_type tmp = const_cast<const volatile storage_type &>(v_);
799 
800  value_type v;
801  memcpy(&v, &tmp, sizeof(value_type));
802  return v;
803  }
804 
805  value_type
806  exchange(value_type v, memory_order order = memory_order_seq_cst) volatile
807  {
808  value_type original = load(memory_order_relaxed);
809  do {
810  } while (!compare_exchange_weak(original, v, order, memory_order_relaxed));
811  return original;
812  }
813 
814  bool
816  value_type & expected,
817  value_type desired,
818  memory_order success_order,
819  memory_order failure_order) volatile
820  {
821  return compare_exchange_strong(expected, desired, success_order, failure_order);
822  }
823 
824  bool
826  value_type & expected,
827  value_type desired,
828  memory_order success_order,
829  memory_order failure_order) volatile
830  {
831 
832  storage_type expected_s = 0, desired_s = 0;
833  memcpy(&expected_s, &expected, sizeof(value_type));
834  memcpy(&desired_s, &desired, sizeof(value_type));
835 
836  platform_fence_before(success_order);
837  bool success = platform_cmpxchg32_strong(expected_s, desired_s, &v_);
838 
839  if (success) {
840  platform_fence_after(success_order);
841  } else {
842  platform_fence_after(failure_order);
843  memcpy(&expected, &expected_s, sizeof(value_type));
844  }
845 
846  return success;
847  }
848 
849  bool
850  is_lock_free(void) const volatile
851  {
852  return true;
853  }
854 
856 private:
857  base_atomic(const base_atomic &) /* = delete */ ;
858  void operator=(const base_atomic &) /* = delete */ ;
859  storage_type v_;
860 };
861 
862 }
863 }
864 }
865 
866 #endif
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_before_store(memory_order order)
Definition: gcc-armv6+.hpp:128
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order, memory_order) volatile
Definition: base.hpp:166
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_sub(difference_type v, memory_order order=memory_order_seq_cst) volatile
Definition: base.hpp:116
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_after_load(memory_order order)
Definition: gcc-armv6+.hpp:141
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
static void platform_fence_after_store(memory_order order)
Definition: gcc-armv6+.hpp:134
value_type load(memory_order order=memory_order_seq_cst) const volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
Definition: cas32strong.hpp:92
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
Definition: cas32strong.hpp:49
value_type load(memory_order order=memory_order_seq_cst) const volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_add(difference_type v, memory_order order=memory_order_seq_cst) volatile
#define BOOST_ATOMIC_DECLARE_POINTER_OPERATORS
Definition: base.hpp:107
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order=memory_order_seq_cst) volatileconst
Definition: base.hpp:156
bool platform_cmpxchg32_strong(T &expected, T desired, volatile T *ptr)
Definition: gcc-cas.hpp:96
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
Definition: cas32strong.hpp:33
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type fetch_sub(difference_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile
static void platform_fence_after(memory_order order)
Definition: gcc-armv6+.hpp:116
#define BOOST_ATOMIC_DECLARE_BASE_OPERATORS
Definition: base.hpp:19
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_or(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
Definition: cas32strong.hpp:58
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
bool compare_exchange_weak(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
Definition: base.hpp:184
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
Definition: cas32strong.hpp:68
value_type fetch_xor(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
#define BOOST_ATOMIC_DECLARE_INTEGRAL_OPERATORS
Definition: base.hpp:111
bool compare_exchange_strong(value_type &expected, value_type desired, memory_order success_order, memory_order failure_order) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
static void platform_fence_before(memory_order order)
Definition: gcc-armv6+.hpp:103
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
Definition: cas32strong.hpp:41
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type load(memory_order order=memory_order_seq_cst) const volatile
void store(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_add(difference_type v, memory_order order=memory_order_seq_cst) volatile
value_type exchange(value_type v, memory_order order=memory_order_seq_cst) volatile
void operator=(const base_atomic &)
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_and(value_type v, memory_order order=memory_order_seq_cst) volatile
value_type fetch_sub(value_type v, memory_order order=memory_order_seq_cst) volatile


rosatomic
Author(s): Josh Faust
autogenerated on Fri Apr 5 2019 02:16:35