summaryrefslogtreecommitdiffstats
path: root/runtime/prop.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-04-27 17:49:06 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-04-27 17:49:06 +0200
commit4a5a3196fbe4e5a4e9f8dea49f916462adbf3098 (patch)
treedf7750c93603d4a979188f3385c9fe4997072c7f /runtime/prop.c
parent9cf1756dc6c06682b32ed7a789ceb4254b5792df (diff)
parentcbe2e3d44496ec7c6418e7e74ce917f2086a2947 (diff)
downloadrsyslog-4a5a3196fbe4e5a4e9f8dea49f916462adbf3098.tar.gz
rsyslog-4a5a3196fbe4e5a4e9f8dea49f916462adbf3098.tar.xz
rsyslog-4a5a3196fbe4e5a4e9f8dea49f916462adbf3098.zip
Merge branch 'v4-devel' into master
Conflicts: runtime/Makefile.am runtime/atomic.h runtime/queue.c runtime/queue.h runtime/wti.c runtime/wti.h runtime/wtp.c runtime/wtp.h
Diffstat (limited to 'runtime/prop.c')
-rw-r--r--runtime/prop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/prop.c b/runtime/prop.c
index 94d1bd49..d925bb43 100644
--- a/runtime/prop.c
+++ b/runtime/prop.c
@@ -53,6 +53,7 @@ DEFobjStaticHelpers
*/
BEGINobjConstruct(prop) /* be sure to specify the object type also in END macro! */
pThis->iRefCount = 1;
+ INIT_ATOMIC_HELPER_MUT(pThis->mutRefCount);
ENDobjConstruct(prop)
@@ -60,11 +61,12 @@ ENDobjConstruct(prop)
BEGINobjDestruct(prop) /* be sure to specify the object type also in END and CODESTART macros! */
int currRefCount;
CODESTARTobjDestruct(prop)
- currRefCount = ATOMIC_DEC_AND_FETCH(pThis->iRefCount);
+ currRefCount = ATOMIC_DEC_AND_FETCH(&pThis->iRefCount, &pThis->mutRefCount);
if(currRefCount == 0) {
/* (only) in this case we need to actually destruct the object */
if(pThis->len >= CONF_PROP_BUFSIZE)
free(pThis->szVal.psz);
+ DESTROY_ATOMIC_HELPER_MUT(pThis->mutRefCount);
} else {
pThis = NULL; /* tell framework NOT to destructing the object! */
}
@@ -132,7 +134,7 @@ propConstructFinalize(prop_t __attribute__((unused)) *pThis)
*/
static rsRetVal AddRef(prop_t *pThis)
{
- ATOMIC_INC(pThis->iRefCount);
+ ATOMIC_INC(&pThis->iRefCount, &pThis->mutRefCount);
return RS_RET_OK;
}