diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-25 12:05:25 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-25 12:05:25 +0200 |
commit | e56a30372e807019618570ed70874a3389da2ac2 (patch) | |
tree | 58f5bb1fba50ec022a5ad46c0e62f3ef3e533a3a /runtime/wti.c | |
parent | 46024834449840dabf399dda196c9dd11cf78ace (diff) | |
parent | d12b9e0c67cc72c9b1631bf2a5611d383e7ad69d (diff) | |
download | rsyslog-e56a30372e807019618570ed70874a3389da2ac2.tar.gz rsyslog-e56a30372e807019618570ed70874a3389da2ac2.tar.xz rsyslog-e56a30372e807019618570ed70874a3389da2ac2.zip |
Merge branch 'master' into v5-devel
Conflicts:
runtime/atomic.h
runtime/wti.c
Diffstat (limited to 'runtime/wti.c')
-rw-r--r-- | runtime/wti.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/wti.c b/runtime/wti.c index c9fc4879..9c137f57 100644 --- a/runtime/wti.c +++ b/runtime/wti.c @@ -146,8 +146,11 @@ wtiSetState(wti_t *pThis, qWrkCmd_t tCmd, int bActiveOnly, int bLockMutex) /* DO NOTHING */ break; } - /* better do a CAS? */ - ATOMIC_STORE_INT_TO_INT(pThis->tCurrCmd, tCmd); /* apply the new state */ + /* apply the new state */ + unsigned val = ATOMIC_CAS_VAL(pThis->tCurrCmd, tCurrCmd, tCmd); + if(val != tCurrCmd) { + DBGPRINTF("wtiSetState PROBLEM, tCurrCmd %d overwritten with %d, wanted to set %d\n", tCurrCmd, val, tCmd); + } } END_MTX_PROTECTED_OPERATIONS(&pThis->mut); |