[Xenomai-git] Jan Kiszka : testsuite/smokey/xddp: Poll for registry link to appear
Module: xenomai-3 Branch: master Commit: ba90c10bbd464bb19cb4d185f19bf862bca5aedf URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ba90c10bbd464bb19cb4d185f19bf862bca5aedf Author: Jan Kiszka Date: Fri Jan 9 21:41:39 2015 +0100 testsuite/smokey/xddp: Poll for registry link to appear Registry updates happen asynchronously, and the NRT thread may fire up before this. So spin until we find the desired entry. This avoids sporadic test failures with open() failing on fast multicore machines. Remove the unused and misleading sem_post from thread2 at this chance. Signed-off-by: Jan Kiszka --- testsuite/smokey/xddp/xddp.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/smokey/xddp/xddp.c b/testsuite/smokey/xddp/xddp.c index 6dca6e6..8c4a4af 100644 --- a/testsuite/smokey/xddp/xddp.c +++ b/testsuite/smokey/xddp/xddp.c @@ -137,7 +137,6 @@ static void *realtime_thread2(void *arg) fail("setsockopt"); sem_sync(&semsync); - sem_post(&semsync); /* unleash regular thread */ memset(&saddr, 0, sizeof(saddr)); saddr.sipc_family = AF_RTIPC; @@ -197,7 +196,9 @@ static void *regular_thread(void *arg) XDDP_PORT_LABEL) < 0) fail("asprintf"); - fd = open(devname, O_RDWR); + do + fd = open(devname, O_RDWR); + while (fd < 0 && errno == ENOENT); free(devname); if (fd < 0) fail("open"); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : testsuite/smokey/xddp: Poll for registry link to appear
Module: xenomai-3 Branch: next Commit: ba90c10bbd464bb19cb4d185f19bf862bca5aedf URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ba90c10bbd464bb19cb4d185f19bf862bca5aedf Author: Jan Kiszka Date: Fri Jan 9 21:41:39 2015 +0100 testsuite/smokey/xddp: Poll for registry link to appear Registry updates happen asynchronously, and the NRT thread may fire up before this. So spin until we find the desired entry. This avoids sporadic test failures with open() failing on fast multicore machines. Remove the unused and misleading sem_post from thread2 at this chance. Signed-off-by: Jan Kiszka --- testsuite/smokey/xddp/xddp.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/smokey/xddp/xddp.c b/testsuite/smokey/xddp/xddp.c index 6dca6e6..8c4a4af 100644 --- a/testsuite/smokey/xddp/xddp.c +++ b/testsuite/smokey/xddp/xddp.c @@ -137,7 +137,6 @@ static void *realtime_thread2(void *arg) fail("setsockopt"); sem_sync(&semsync); - sem_post(&semsync); /* unleash regular thread */ memset(&saddr, 0, sizeof(saddr)); saddr.sipc_family = AF_RTIPC; @@ -197,7 +196,9 @@ static void *regular_thread(void *arg) XDDP_PORT_LABEL) < 0) fail("asprintf"); - fd = open(devname, O_RDWR); + do + fd = open(devname, O_RDWR); + while (fd < 0 && errno == ENOENT); free(devname); if (fd < 0) fail("open"); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : testsuite/smokey/xddp: Poll for registry link to appear
Module: xenomai-jki Branch: for-forge Commit: a15136923e620950c7f1b3aafae208a4c7b0e6be URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=a15136923e620950c7f1b3aafae208a4c7b0e6be Author: Jan Kiszka Date: Fri Jan 9 21:41:39 2015 +0100 testsuite/smokey/xddp: Poll for registry link to appear Registry updates happen asynchronously, and the NRT thread may fire up before this. So spin until we find the desired entry. This avoids sporadic test failures with open() failing on fast multicore machines. Remove the unused and misleading sem_post from thread2 at this chance. Signed-off-by: Jan Kiszka --- testsuite/smokey/xddp/xddp.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/smokey/xddp/xddp.c b/testsuite/smokey/xddp/xddp.c index 6dca6e6..8c4a4af 100644 --- a/testsuite/smokey/xddp/xddp.c +++ b/testsuite/smokey/xddp/xddp.c @@ -137,7 +137,6 @@ static void *realtime_thread2(void *arg) fail("setsockopt"); sem_sync(&semsync); - sem_post(&semsync); /* unleash regular thread */ memset(&saddr, 0, sizeof(saddr)); saddr.sipc_family = AF_RTIPC; @@ -197,7 +196,9 @@ static void *regular_thread(void *arg) XDDP_PORT_LABEL) < 0) fail("asprintf"); - fd = open(devname, O_RDWR); + do + fd = open(devname, O_RDWR); + while (fd < 0 && errno == ENOENT); free(devname); if (fd < 0) fail("open"); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : testsuite/smokey/xddp: Poll for registry link to appear
Module: xenomai-3 Branch: next Commit: 547ea54b2705e3007d998557f78f6d37fca8e13f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=547ea54b2705e3007d998557f78f6d37fca8e13f Author: Jan Kiszka Date: Fri Jan 9 21:41:39 2015 +0100 testsuite/smokey/xddp: Poll for registry link to appear Registry updates happen asynchronously, and the NRT thread may fire up before this. So spin until we find the desired entry. This avoids sporadic test failures with open() failing on fast multicore machines. Remove the unused and misleading sem_post from thread2 at this chance. Signed-off-by: Jan Kiszka --- testsuite/smokey/xddp/xddp.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/smokey/xddp/xddp.c b/testsuite/smokey/xddp/xddp.c index 6dca6e6..8c4a4af 100644 --- a/testsuite/smokey/xddp/xddp.c +++ b/testsuite/smokey/xddp/xddp.c @@ -137,7 +137,6 @@ static void *realtime_thread2(void *arg) fail("setsockopt"); sem_sync(&semsync); - sem_post(&semsync); /* unleash regular thread */ memset(&saddr, 0, sizeof(saddr)); saddr.sipc_family = AF_RTIPC; @@ -197,7 +196,9 @@ static void *regular_thread(void *arg) XDDP_PORT_LABEL) < 0) fail("asprintf"); - fd = open(devname, O_RDWR); + do + fd = open(devname, O_RDWR); + while (fd < 0 && errno == ENOENT); free(devname); if (fd < 0) fail("open"); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : testsuite/smokey/xddp: Poll for registry link to appear
Module: xenomai-jki Branch: for-forge Commit: ee639dfc8569d290327b749a639fbb391b9c9eb4 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ee639dfc8569d290327b749a639fbb391b9c9eb4 Author: Jan Kiszka Date: Fri Jan 9 21:41:39 2015 +0100 testsuite/smokey/xddp: Poll for registry link to appear Registry updates happen asynchronously, and the NRT thread may fire up before this. So spin until we find the desired entry. This avoids sporadic test failures with open() failing on fast multicore machines. Remove the unused and misleading sem_post from thread2 at this chance. Signed-off-by: Jan Kiszka --- testsuite/smokey/xddp/xddp.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/smokey/xddp/xddp.c b/testsuite/smokey/xddp/xddp.c index 6dca6e6..8c4a4af 100644 --- a/testsuite/smokey/xddp/xddp.c +++ b/testsuite/smokey/xddp/xddp.c @@ -137,7 +137,6 @@ static void *realtime_thread2(void *arg) fail("setsockopt"); sem_sync(&semsync); - sem_post(&semsync); /* unleash regular thread */ memset(&saddr, 0, sizeof(saddr)); saddr.sipc_family = AF_RTIPC; @@ -197,7 +196,9 @@ static void *regular_thread(void *arg) XDDP_PORT_LABEL) < 0) fail("asprintf"); - fd = open(devname, O_RDWR); + do + fd = open(devname, O_RDWR); + while (fd < 0 && errno == ENOENT); free(devname); if (fd < 0) fail("open"); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git