diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-12 17:12:10 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-12 17:12:10 +0100 |
commit | 8b246de2a587454f9260ff91192d27a2e168ea2d (patch) | |
tree | eaf442ec207ba1f626119be4f983c69c9c2b5ba3 /runtime/apc.c | |
parent | 6b722a09d419ad2a552710260bb8e220858f17c2 (diff) | |
download | rsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.tar.gz rsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.tar.xz rsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.zip |
some light performance enhancement
...by replacing time() call with much faster (at least under linux)
gettimeofday() calls.
Diffstat (limited to 'runtime/apc.c')
-rw-r--r-- | runtime/apc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/apc.c b/runtime/apc.c index c2f61266..3c6b7ec4 100644 --- a/runtime/apc.c +++ b/runtime/apc.c @@ -40,9 +40,11 @@ #include "obj.h" #include "apc.h" #include "srUtils.h" +#include "datetime.h" /* static data */ DEFobjStaticHelpers +DEFobjCurrIf(datetime) /* following is a used to implement a monotonically increasing id for the apcs. That * ID can be used to cancel an apc request. Note that the ID is generated with modulo @@ -200,7 +202,7 @@ unlistCurrent(apc_list_t **ppList) DEFiRet; assert(ppList != NULL); - time(&tCurr); + datetime.GetTime(&tCurr); if(apcListRoot == NULL || apcListRoot->pApc->ttExec > tCurr) { *ppList = NULL; @@ -375,7 +377,7 @@ ENDobjQueryInterface(apc) * rgerhards, 2009-04-06 */ BEGINObjClassExit(apc, OBJ_IS_CORE_MODULE) /* class, version */ - //objRelease(apcstk, CORE_COMPONENT); + objRelease(datetime, CORE_COMPONENT); pthread_mutex_destroy(&listMutex); ENDObjClassExit(apc) @@ -386,7 +388,7 @@ ENDObjClassExit(apc) */ BEGINObjClassInit(apc, 1, OBJ_IS_CORE_MODULE) /* class, version */ /* request objects we use */ - //CHKiRet(objUse(apcstk, CORE_COMPONENT)); + CHKiRet(objUse(datetime, CORE_COMPONENT)); /* set our own handlers */ OBJSetMethodHandler(objMethod_DEBUGPRINT, apcDebugPrint); |