From 1c2615c1421db844cb5ba490ff1f7197c6cc77dd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Jul 2020 11:41:17 +0200 Subject: [FUSE] Detach old receive thread when creating anew one, update var --- src/fuse/connection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fuse') diff --git a/src/fuse/connection.c b/src/fuse/connection.c index beb4a31..f9e942b 100644 --- a/src/fuse/connection.c +++ b/src/fuse/connection.c @@ -831,7 +831,6 @@ fail: static void switchConnection( int sockFd, alt_server_t *srv ) { - pthread_t thread; struct sockaddr_storage addr; socklen_t addrLen = sizeof( addr ); char message[200] = "Connection switched to "; @@ -862,8 +861,9 @@ static void switchConnection( int sockFd, alt_server_t *srv ) signal_call( connection.panicSignal ); return; } + pthread_detach( tidReceiver ); timing_get( &connection.startupTime ); - pthread_create( &thread, NULL, &connection_receiveThreadMain, ( void* )(size_t)sockFd ); + pthread_create( &tidReceiver, NULL, &connection_receiveThreadMain, ( void* )(size_t)sockFd ); sock_printable( (struct sockaddr*)&addr, sizeof( addr ), message + len, sizeof( message ) - len ); logadd( LOG_INFO, "%s", message ); // resend queue -- cgit v1.2.3-55-g7522