Module: xenomai-3
Branch: next
Commit: 547ea54b2705e3007d998557f78f6d37fca8e13f
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=547ea54b2705e3007d998557f78f6d37fca8e13f

Author: Jan Kiszka <jan.kis...@siemens.com>
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 <jan.kis...@siemens.com>

---

 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

Reply via email to