diff options
author | Simon Rettberg | 2020-07-24 11:41:17 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-07-24 11:41:17 +0200 |
commit | 1c2615c1421db844cb5ba490ff1f7197c6cc77dd (patch) | |
tree | db6083530d3cc1ad969700ce9b5dc342587c59b7 /src/fuse | |
parent | [FUSE] Refactor signal handling on termination again (diff) | |
download | dnbd3-1c2615c1421db844cb5ba490ff1f7197c6cc77dd.tar.gz dnbd3-1c2615c1421db844cb5ba490ff1f7197c6cc77dd.tar.xz dnbd3-1c2615c1421db844cb5ba490ff1f7197c6cc77dd.zip |
[FUSE] Detach old receive thread when creating anew one, update var
Diffstat (limited to 'src/fuse')
-rw-r--r-- | src/fuse/connection.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |