multipath-tools: replace pthread_yield with sched_yield
authorXose Vazquez Perez <xose.vazquez@gmail.com>
Thu, 20 Oct 2016 23:16:20 +0000 (01:16 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Thu, 3 Nov 2016 13:00:02 +0000 (14:00 +0100)
pthread_yield is not standard.
It was added in 6e14b7b

Please review.

Patch from Alpine Linux: http://git.alpinelinux.org/cgit/aports/plain/main/multipath-tools/fix-yield.patch

Cc: Natanael Copa <ncopa@alpinelinux.org>
Cc: Leonardo Arena <rnalrd@alpinelinux.org>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
multipathd/uxlsnr.c

index daaaa99..dfef03e 100644 (file)
@@ -182,7 +182,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, void * trigger_data)
                                pthread_mutex_unlock(&client_lock);
                                condlog(0, "%s: failed to realloc %d poll fds",
                                        "uxsock", 1 + num_clients);
                                pthread_mutex_unlock(&client_lock);
                                condlog(0, "%s: failed to realloc %d poll fds",
                                        "uxsock", 1 + num_clients);
-                               pthread_yield();
+                               sched_yield();
                                continue;
                        }
                        old_clients = num_clients;
                                continue;
                        }
                        old_clients = num_clients;