diff options
| author | erdgeist <> | 2007-11-19 21:14:09 +0000 |
|---|---|---|
| committer | erdgeist <> | 2007-11-19 21:14:09 +0000 |
| commit | 6d09527ed8442e856920686bd03fa2d582da6956 (patch) | |
| tree | 4ea3ade94bc492859db1a482975d48fcb224016b | |
| parent | 49ba269b9d09746e90e153f3e245eaf3f97e35cc (diff) | |
Fullscrape now cleanly finalizes its thread
| -rw-r--r-- | ot_fullscrape.c | 6 | ||||
| -rw-r--r-- | ot_fullscrape.h | 1 |
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 | ||
| 55 | static pthread_t thread_id; | ||
| 55 | void fullscrape_init( ) { | 56 | void 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 | ||
| 60 | void fullscrape_deinit( ) { | ||
| 61 | pthread_cancel( thread_id ); | ||
| 62 | } | ||
| 63 | |||
| 60 | void fullscrape_deliver( int64 socket, ot_tasktype tasktype ) { | 64 | void 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 | ||
| 10 | void fullscrape_init( ); | 10 | void fullscrape_init( ); |
| 11 | void fullscrape_deinit( ); | ||
| 11 | void fullscrape_deliver( int64 socket, ot_tasktype tasktype ); | 12 | void fullscrape_deliver( int64 socket, ot_tasktype tasktype ); |
| 12 | 13 | ||
| 13 | #endif | 14 | #endif |
