diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-22 15:06:45 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-22 15:06:45 +0200 |
commit | 7667845bd72b6f92eabc975318a4f288a77f2630 (patch) | |
tree | 54b839ee7b3ae5347145bf4c721600ce5ca411b5 /runtime/wtp.h | |
parent | b0cfe39c851de0851d88e1b6a51bf40a76fb8304 (diff) | |
download | rsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.tar.gz rsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.tar.xz rsyslog-7667845bd72b6f92eabc975318a4f288a77f2630.zip |
first attempt at dequeueing multiple batches inside the queue
... but this code has serious problems when terminating the queue, also
it is far from being optimal. I will commit a series of patches (hopefully)
as I am on the path to the final implementation.
Diffstat (limited to 'runtime/wtp.h')
-rw-r--r-- | runtime/wtp.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/wtp.h b/runtime/wtp.h index b9cb07c5..5894000a 100644 --- a/runtime/wtp.h +++ b/runtime/wtp.h @@ -67,10 +67,11 @@ typedef struct wtp_s { int bThrdStateChanged; /* at least one thread state has changed if 1 */ /* end sync variables */ /* user objects */ - void *pUsr; /* pointer to user object */ + void *pUsr; /* pointer to user object (in this case, the queue the wtp belongs to) */ pthread_mutex_t *pmutUsr; pthread_cond_t *pcondBusy; /* condition the user will signal "busy again, keep runing" on (awakes worker) */ rsRetVal (*pfChkStopWrkr)(void *pUsr, int); + rsRetVal (*pfGetDeqMaxAtOnce)(void *pUsr, int*); /* obtains max dequeue count from queue config */ rsRetVal (*pfRateLimiter)(void *pUsr); rsRetVal (*pfIsIdle)(void *pUsr, int); rsRetVal (*pfDoWork)(void *pUsr, void *pWti, int); @@ -104,6 +105,7 @@ int wtpGetCurNumWrkr(wtp_t *pThis, int bLockMutex); PROTOTYPEObjClassInit(wtp); PROTOTYPEpropSetMethFP(wtp, pfChkStopWrkr, rsRetVal(*pVal)(void*, int)); PROTOTYPEpropSetMethFP(wtp, pfRateLimiter, rsRetVal(*pVal)(void*)); +PROTOTYPEpropSetMethFP(wtp, pfGetDeqMaxAtOnce, rsRetVal(*pVal)(void*, int*)); PROTOTYPEpropSetMethFP(wtp, pfIsIdle, rsRetVal(*pVal)(void*, int)); PROTOTYPEpropSetMethFP(wtp, pfDoWork, rsRetVal(*pVal)(void*, void*, int)); PROTOTYPEpropSetMethFP(wtp, pfOnIdle, rsRetVal(*pVal)(void*, int)); |