diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-30 14:20:01 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-09-30 14:20:01 +0200 |
commit | 5a1a73b4326d97789b5640225be0e25cb8dd8de7 (patch) | |
tree | 990de120cd608ccb83a89e54ba4441bc4c9e9fd3 /runtime/queue.c | |
parent | d03fb1b9058a3e81c8d0ba72b916d514106567ed (diff) | |
download | rsyslog-5a1a73b4326d97789b5640225be0e25cb8dd8de7.tar.gz rsyslog-5a1a73b4326d97789b5640225be0e25cb8dd8de7.tar.bz2 rsyslog-5a1a73b4326d97789b5640225be0e25cb8dd8de7.zip |
improved threading
- changed sequence when awakening thread
- removed no longer needed condition variable
- EXPERIMENTALLY added mutex guarding to hostname lookups
this is to be removed if it does not have any verifyable
useful effect
Diffstat (limited to 'runtime/queue.c')
-rw-r--r-- | runtime/queue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/queue.c b/runtime/queue.c index 3fae4aa7..76c2f10f 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1430,8 +1430,13 @@ queueDequeueConsumable(queue_t *pThis, wti_t *pWti, int iCancelStateSave) pthread_cond_broadcast(&pThis->belowLightDlyWtrMrk); } - d_pthread_mutex_unlock(pThis->mut); + /* rgerhards, 2008-09-30: I reversed the order of cond_signal und mutex_unlock + * as of the pthreads recommendation on predictable scheduling behaviour. I don't see + * any problems caused by this, but I add this comment in case some will be seen + * in the next time. + */ pthread_cond_signal(&pThis->notFull); + d_pthread_mutex_unlock(pThis->mut); pthread_setcancelstate(iCancelStateSave, NULL); /* WE ARE NO LONGER PROTECTED BY THE MUTEX */ |