projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
arch,lib/seqlock: implement seqlock with C++ atomic if compiled with C++
[fio.git]
/
lib
/
seqlock.h
diff --git
a/lib/seqlock.h
b/lib/seqlock.h
index 56f3e37dab5b35750a390714c3af2d9579de5628..ef3aa0918df461ba3f60cf99b9d2d1f83b17095b 100644
(file)
--- a/
lib/seqlock.h
+++ b/
lib/seqlock.h
@@
-5,7
+5,11
@@
#include "../arch/arch.h"
struct seqlock {
+#ifdef __cplusplus
+ std::atomic<unsigned int> sequence;
+#else
volatile unsigned int sequence;
+#endif
};
static inline void seqlock_init(struct seqlock *s)