summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-11-19 21:14:09 +0000
committererdgeist <>2007-11-19 21:14:09 +0000
commit6d09527ed8442e856920686bd03fa2d582da6956 (patch)
tree4ea3ade94bc492859db1a482975d48fcb224016b
parent49ba269b9d09746e90e153f3e245eaf3f97e35cc (diff)
Fullscrape now cleanly finalizes its thread
-rw-r--r--ot_fullscrape.c6
-rw-r--r--ot_fullscrape.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/ot_fullscrape.c b/ot_fullscrape.c
index 6f898c4..bcf238c 100644
--- a/ot_fullscrape.c
+++ b/ot_fullscrape.c
@@ -52,11 +52,15 @@ static void * fullscrape_worker( void * args) {
52 return NULL; 52 return NULL;
53} 53}
54 54
55static pthread_t thread_id;
55void fullscrape_init( ) { 56void fullscrape_init( ) {
56 pthread_t thread_id;
57 pthread_create( &thread_id, NULL, fullscrape_worker, NULL ); 57 pthread_create( &thread_id, NULL, fullscrape_worker, NULL );
58} 58}
59 59
60void fullscrape_deinit( ) {
61 pthread_cancel( thread_id );
62}
63
60void fullscrape_deliver( int64 socket, ot_tasktype tasktype ) { 64void fullscrape_deliver( int64 socket, ot_tasktype tasktype ) {
61 mutex_workqueue_pushtask( socket, tasktype ); 65 mutex_workqueue_pushtask( socket, tasktype );
62} 66}
diff --git a/ot_fullscrape.h b/ot_fullscrape.h
index ef27c5c..22ef3cb 100644
--- a/ot_fullscrape.h
+++ b/ot_fullscrape.h
@@ -8,6 +8,7 @@
8#include "ot_mutex.h" 8#include "ot_mutex.h"
9 9
10void fullscrape_init( ); 10void fullscrape_init( );
11void fullscrape_deinit( );
11void fullscrape_deliver( int64 socket, ot_tasktype tasktype ); 12void fullscrape_deliver( int64 socket, ot_tasktype tasktype );
12 13
13#endif 14#endif