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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jul 14 17:57:35 2014 +0200

trank: restrict pthread_make_periodic_np() emulation to self

---

 lib/trank/posix.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/trank/posix.c b/lib/trank/posix.c
index 036d98b..ddada56 100644
--- a/lib/trank/posix.c
+++ b/lib/trank/posix.c
@@ -48,6 +48,11 @@
  * - ESRCH, @a thread is invalid.
  * - ETIMEDOUT, the start time has already passed.
  * - EPERM, the caller is not a Xenomai thread.
+ * - EINVAL, @a thread does not refer to the current thread.
+ *
+ * @note Unlike the original Xenomai 2.x call, this emulation does not
+ * delay the caller waiting for the first periodic release point. In
+ * addition, @a thread must be equal to pthread_self().
  *
  * @deprecated This service is a non-portable extension of the Xenomai
  * 2.x POSIX interface, not available with Xenomai 3.x.  Instead,
@@ -71,6 +76,9 @@ int pthread_make_periodic_np(pthread_t thread,
        if (tc == NULL)
                return EPERM;
 
+       if (thread != pthread_self())
+               return EINVAL;
+
        if (tc->periodic_timer == NULL) {
                memset(&sev, 0, sizeof(sev));
                sev.sigev_signo = SIGPERIOD;


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

Reply via email to