Cygwin: AF_UNIX: make sure connect wait thread is cleanly interruptible
Using TerminateThread potentially leaks resources. In our case, the connect wait thread may be forcefully terminated after having successfully opened a client side pipe handle. If this occurs, we have a stale pipe server instance, so the pipe will never be closed as long as the process lives. Avoid this by changing the npfs handle to non-blocking, so we can wait on a termination event object from inside the thread itself and cleanly exit from the thread instead of terminating. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -860,6 +860,7 @@ class fhandler_socket_unix : public fhandler_socket
|
||||
if the socket is backed by a file in the
|
||||
file system (actually a reparse point) */
|
||||
HANDLE connect_wait_thr;
|
||||
HANDLE cwt_termination_evt;
|
||||
PVOID cwt_param;
|
||||
LONG so_error;
|
||||
sun_name_t *sun_path;
|
||||
|
Reference in New Issue
Block a user