Browse code

* clamd/thrmgr.c (thrmgr_printstats, IDLE_TASK): add comments * contrib/clamdtop/TODO: more TODO items

git-svn: trunk@4328

Török Edvin authored on 2008/11/04 18:13:24
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Nov  4 11:36:38 EET 2008 (edwin)
2
+------------------------------------
3
+ * clamd/thrmgr.c (thrmgr_printstats, IDLE_TASK): add comments
4
+ * contrib/clamdtop/TODO: more TODO items
5
+
1 6
 Tue Nov  4 11:32:16 EET 2008 (edwin)
2 7
 ------------------------------------
3 8
  * clamd/thrmgr.c: fix whitespace
... ...
@@ -234,6 +234,7 @@ int thrmgr_printstats(int f)
234 234
 				inf.uordblks/(1024*1024.0), inf.fordblks/(1024*1024.0),
235 235
 				inf.keepcost/(1024*1024.0));
236 236
 	}
237
+	/* TODO: figure out how to print these statistics on other OSes */
237 238
 #endif
238 239
 	mdprintf(f,"END\n");
239 240
 	pthread_mutex_unlock(&pools_lock);
... ...
@@ -376,6 +377,8 @@ static void stats_tls_key_alloc(void)
376 376
 }
377 377
 
378 378
 static const char *IDLE_TASK = "IDLE";
379
+
380
+/* no mutex is needed, we are using  thread local variable */
379 381
 void thrmgr_setactivetask(const char *filename, const char* command)
380 382
 {
381 383
 	struct task_desc *desc = pthread_getspecific(stats_tls_key);
... ...
@@ -390,6 +393,7 @@ void thrmgr_setactivetask(const char *filename, const char* command)
390 390
 	}
391 391
 }
392 392
 
393
+/* thread pool mutex must be held on entry */
393 394
 static void stats_init(threadpool_t *pool)
394 395
 {
395 396
 	struct task_desc *desc = calloc(1, sizeof(*desc));
... ...
@@ -406,6 +410,7 @@ static void stats_init(threadpool_t *pool)
406 406
 	}
407 407
 }
408 408
 
409
+/* thread pool mutex must be held on entry */
409 410
 static void stats_destroy(threadpool_t *pool)
410 411
 {
411 412
 	struct task_desc *desc = pthread_getspecific(stats_tls_key);
... ...
@@ -1,3 +1,5 @@
1 1
 monitor more than one remote clamd
2 2
 write a manpage
3 3
 consider writing a GUI using Tk 8.5 (version 8.5 has much nicer widgets than 8.4)
4
+integrate into toplevel clamav, and build if ncurses is available (optional)
5
+figure out minimum version of ncurses required, I used 5.5 during development.