Module: xenomai-3
Branch: wip/drivers
Commit: 4688fd5968fbf65f6d99effc7a582537aef96068
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4688fd5968fbf65f6d99effc7a582537aef96068

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jul  7 10:23:43 2016 +0200

copperplate/threadobj: mercury: fix error code in corespec_init call

At this chance, give a hint about a common cause of failure to set the
condvar clock, i.e. CLOCK_MONOTONIC_RAW not available.

---

 lib/copperplate/threadobj.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 831446a..e52984b 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -596,8 +596,12 @@ static inline int threadobj_init_corespec(struct threadobj 
*thobj)
         */
        pthread_condattr_init(&cattr);
        pthread_condattr_setpshared(&cattr, mutex_scope_attribute);
-       ret = __bt(pthread_condattr_setclock(&cattr, CLOCK_COPPERPLATE));
-       if (ret == 0)
+       ret = __bt(-pthread_condattr_setclock(&cattr, CLOCK_COPPERPLATE));
+       if (ret)
+               warning("failed setting condvar clock, %s"
+                       "(try --disable-clock-monotonic-raw)",
+                       symerror(ret));
+       else
                ret = __bt(-pthread_cond_init(&thobj->core.grant_sync, &cattr));
        pthread_condattr_destroy(&cattr);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to