diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-30 15:41:29 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-30 15:41:29 +0100 |
commit | 0d6905909191c0da885e132306c68e7e0690a286 (patch) | |
tree | 7b699ad39cb2a93bf87267d6efccab868b1a7eda /runtime/atomic.h | |
parent | a2f547fdbfcad6cdc641b8958ccc2dac761b02b6 (diff) | |
parent | 25245cc682bd1a4854cc8b33e301bb4f0cb48fc6 (diff) | |
download | rsyslog-0d6905909191c0da885e132306c68e7e0690a286.tar.gz rsyslog-0d6905909191c0da885e132306c68e7e0690a286.tar.xz rsyslog-0d6905909191c0da885e132306c68e7e0690a286.zip |
Merge branch 'beta'
Diffstat (limited to 'runtime/atomic.h')
-rw-r--r-- | runtime/atomic.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/atomic.h b/runtime/atomic.h index ec7acb8c..fdf64214 100644 --- a/runtime/atomic.h +++ b/runtime/atomic.h @@ -47,6 +47,13 @@ # define ATOMIC_FETCH_32BIT(data) ((unsigned) __sync_fetch_and_and(&(data), 0xffffffff)) # define ATOMIC_STORE_1_TO_32BIT(data) __sync_lock_test_and_set(&(data), 1) #else + /* note that we gained parctical proof that theoretical problems DO occur + * if we do not properly address them. See this blog post for details: + * http://blog.gerhards.net/2009/01/rsyslog-data-race-analysis.html + * The bottom line is that if there are no atomics available, we should NOT + * simply go ahead and do without them - use mutexes or other things. The + * code needs to be checked against all those cases. -- rgerhards, 2009-01-30 + */ # warning "atomic builtins not available, using nul operations - rsyslogd will probably be racy!" # define ATOMIC_INC(data) (++(data)) # define ATOMIC_DEC(data) (--(data)) |