fix mutex handling

git-svn: trunk@1269
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent afe4ae1417
commit 9fa6473439
  1. 10
      clamav-devel/ChangeLog
  2. 14
      clamav-devel/clamd/thrmgr.c

@ -1,7 +1,13 @@
Mon Jan 24 17:54:14 CET 2005 (tk)
---------------------------------
* clamd/thrmgr.c: unlock mutex if thread->state != POOL_VALID in
thrmgr_dispatch() (thanks to "Andrey J. Melnikoff
(TEMHOTA)" <temnota*kmv.ru>)
Mon Jan 24 13:56:19 GMT 2005 (njh)
----------------------------------
* libclamav/message.c: Some Exploit.IE.CrashSOS were not being caught,
found by Carsten.Borchardt@drs-systemberatung.de
found by Carsten.Borchardt*drs-systemberatung.de
Sat Jan 22 13:45:42 GMT 2005 (njh)
----------------------------------
@ -12,7 +18,7 @@ Sat Jan 22 13:45:42 GMT 2005 (njh)
Redirect stdout and stderr to LogFile, if that is set
--quarantine didn't redirect to the given email address
if --internal was used (reported by N Fung
<nsfung@yahoo.com>)
<nsfung*yahoo.com>)
Thu Jan 20 01:22:48 CET 2005 (tk)
---------------------------------

@ -222,22 +222,26 @@ void *thrmgr_worker(void *arg)
int thrmgr_dispatch(threadpool_t *threadpool, void *user_data)
{
pthread_t thr_id;
if (!threadpool) {
return FALSE;
}
/* Lock the threadpool */
if (pthread_mutex_lock(&(threadpool->pool_mutex)) != 0) {
logg("!Mutex lock failed\n");
return FALSE;
}
if (threadpool->state != POOL_VALID) {
if (pthread_mutex_unlock(&(threadpool->pool_mutex)) != 0) {
logg("!Mutex unlock failed\n");
return FALSE;
}
return FALSE;
}
work_queue_add(threadpool->queue, user_data);
if ((threadpool->thr_idle == 0) &&
(threadpool->thr_alive < threadpool->thr_max)) {
/* Start a new thread */
@ -249,7 +253,7 @@ int thrmgr_dispatch(threadpool_t *threadpool, void *user_data)
}
}
pthread_cond_signal(&(threadpool->pool_cond));
if (pthread_mutex_unlock(&(threadpool->pool_mutex)) != 0) {
logg("!Mutex unlock failed\n");
return FALSE;

Loading…
Cancel
Save