]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Fullscrape now cleanly finalizes its thread
authorerdgeist <>
Mon, 19 Nov 2007 21:14:09 +0000 (21:14 +0000)
committererdgeist <>
Mon, 19 Nov 2007 21:14:09 +0000 (21:14 +0000)
ot_fullscrape.c
ot_fullscrape.h

index 6f898c4f0aeebfe363009400b68021030266bfb1..bcf238cb5a845d383a403f5061a3c42162948a5a 100644 (file)
@@ -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 );
 }
index ef27c5cb0523c89ab4c356a46f8800281915a120..22ef3cbf5463f34635465665e6b5ff5f74f22698 100644 (file)
@@ -8,6 +8,7 @@
 #include "ot_mutex.h"
 
 void fullscrape_init( );
+void fullscrape_deinit( );
 void fullscrape_deliver( int64 socket, ot_tasktype tasktype );
 
 #endif