summaryrefslogtreecommitdiffstats
path: root/runtime/srUtils.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-17 12:38:49 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-17 12:38:49 +0200
commit183b49015561890e148a50128c051a1cdd4491b9 (patch)
treeacdfddd9aab9ab51b590489a5216fd6fecd62d79 /runtime/srUtils.h
parent511fd780a25b59b42e93bb2c9ebc03a4991f5c16 (diff)
downloadrsyslog-183b49015561890e148a50128c051a1cdd4491b9.tar.gz
rsyslog-183b49015561890e148a50128c051a1cdd4491b9.tar.xz
rsyslog-183b49015561890e148a50128c051a1cdd4491b9.zip
more code simplification, should also bring some performance enhancement
reducing the number of thread cancellation state changes
Diffstat (limited to 'runtime/srUtils.h')
-rw-r--r--runtime/srUtils.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/runtime/srUtils.h b/runtime/srUtils.h
index 6d5a784b..c4f73e16 100644
--- a/runtime/srUtils.h
+++ b/runtime/srUtils.h
@@ -110,11 +110,9 @@ rsRetVal getFileSize(uchar *pszName, off_t *pSize);
/* some useful constants */
#define DEFVARS_mutexProtection\
- int iCancelStateSave; \
int bLockedOpIsLocked=0
#define BEGIN_MTX_PROTECTED_OPERATIONS(mut, bMustLock) \
if(bMustLock == LOCK_MUTEX) { \
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); \
d_pthread_mutex_lock(mut); \
assert(bLockedOpIsLocked == 0); \
bLockedOpIsLocked = 1; \
@@ -123,19 +121,6 @@ rsRetVal getFileSize(uchar *pszName, off_t *pSize);
if(bLockedOpIsLocked) { \
d_pthread_mutex_unlock(mut); \
bLockedOpIsLocked = 0; \
- pthread_setcancelstate(iCancelStateSave, NULL); \
}
-/* The unconditional versions of the macro always lock the mutex. They are preferred in
- * complex scenarios, where the simple ones might get mixed up by multiple calls.
- */
-#define DEFVARS_mutexProtection_uncond\
- int iCancelStateSave
-#define BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(mut) \
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); \
- d_pthread_mutex_lock(mut);
-#define END_MTX_PROTECTED_OPERATIONS_UNCOND(mut) \
- d_pthread_mutex_unlock(mut); \
- pthread_setcancelstate(iCancelStateSave, NULL);
-
#endif