tur: Add pthread_testcancel()
authorHannes Reinecke <hare@suse.de>
Tue, 28 Feb 2017 16:23:26 +0000 (17:23 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 23 Mar 2017 08:27:23 +0000 (09:27 +0100)
When the ioctl returns we need to check if a cancellation has
been requested; otherwise we'd be re-setting the state and
overwrite any pending values.

Signed-off-by: Hannes Reinecke <hare@suse.com>
libmultipath/checkers/tur.c

index d9a9e67..b4a5cb2 100644 (file)
@@ -268,6 +268,7 @@ static void *tur_thread(void *ctx)
        pthread_mutex_unlock(&ct->lock);
 
        state = tur_check(ct->fd, ct->timeout, copy_msg_to_tcc, ct->message);
+       pthread_testcancel();
 
        /* TUR checker done */
        pthread_mutex_lock(&ct->lock);