From 6d09527ed8442e856920686bd03fa2d582da6956 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 19 Nov 2007 21:14:09 +0000 Subject: Fullscrape now cleanly finalizes its thread --- ot_fullscrape.c | 6 +++++- ot_fullscrape.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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) { return NULL; } +static pthread_t thread_id; void fullscrape_init( ) { - pthread_t thread_id; pthread_create( &thread_id, NULL, fullscrape_worker, NULL ); } +void fullscrape_deinit( ) { + pthread_cancel( thread_id ); +} + void fullscrape_deliver( int64 socket, ot_tasktype tasktype ) { mutex_workqueue_pushtask( socket, tasktype ); } 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 @@ #include "ot_mutex.h" void fullscrape_init( ); +void fullscrape_deinit( ); void fullscrape_deliver( int64 socket, ot_tasktype tasktype ); #endif -- cgit v1.2.3