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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jun 16 21:00:13 2014 +0200

rtdm: introduce rtdm_task_join(), deprecate rtdm_task_join_nrt()

The new rtdm_task_join() service may be called regardless of the
current execution mode, therefore rtdm_task_join_nrt() becomes
pointless and will be phased out in the next release.

---

 include/cobalt/kernel/rtdm/driver.h |    8 +++++++-
 kernel/cobalt/rtdm/drvlib.c         |   24 +++++++++---------------
 kernel/cobalt/thread.c              |    5 ++++-
 kernel/drivers/testing/switchtest.c |    2 +-
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/include/cobalt/kernel/rtdm/driver.h 
b/include/cobalt/kernel/rtdm/driver.h
index 0627d2b..18c4460 100644
--- a/include/cobalt/kernel/rtdm/driver.h
+++ b/include/cobalt/kernel/rtdm/driver.h
@@ -987,7 +987,13 @@ static inline int rtdm_task_should_stop(void)
        return xnthread_test_info(xnshadow_current(), XNCANCELD);
 }
 
-void rtdm_task_join_nrt(rtdm_task_t *task, unsigned int poll_delay);
+void rtdm_task_join(rtdm_task_t *task);
+
+static inline void __deprecated rtdm_task_join_nrt(rtdm_task_t *task,
+                                                  unsigned int poll_delay)
+{
+       rtdm_task_join(task);
+}
 
 static inline void rtdm_task_set_priority(rtdm_task_t *task, int priority)
 {
diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
index d39fefe..cc1c6f0 100644
--- a/kernel/cobalt/rtdm/drvlib.c
+++ b/kernel/cobalt/rtdm/drvlib.c
@@ -87,7 +87,7 @@ nanosecs_abs_t rtdm_clock_read_monotonic(void);
  *
  * After initialising a task, the task handle remains valid and can be
  * passed to RTDM services until either rtdm_task_destroy() or
- * rtdm_task_join_nrt() was invoked.
+ * rtdm_task_join() was invoked.
  *
  * @param[in,out] task Task handle
  * @param[in] name Optional task name
@@ -317,30 +317,24 @@ EXPORT_SYMBOL_GPL(__rtdm_task_sleep);
  * @brief Wait on a real-time task to terminate
  *
  * @param[in,out] task Task handle as returned by rtdm_task_init()
- * @param[in] poll_delay Delay in milliseconds between periodic tests for the
- * state of the real-time task. This parameter is ignored if the termination
- * is internally realised without polling.
  *
- * @note Passing the same task handle to RTDM services after the completion of
- * this function is not allowed.
+ * @note Passing the same task handle to RTDM services after the
+ * completion of this function is not allowed.
  *
- * @note This service does not trigger the termination of the targeted task.
- * The user has to take of this, otherwise rtdm_task_join_nrt() will never
- * return.
+ * @note This service does not trigger the termination of the targeted
+ * task.  The user has to take of this, otherwise rtdm_task_join()
+ * will never return.
  *
- * @coretags{secondary-only}
+ * @coretags{mode-unrestricted}
  */
-void rtdm_task_join_nrt(rtdm_task_t *task, unsigned int poll_delay)
+void rtdm_task_join(rtdm_task_t *task)
 {
-       if (!XENO_ASSERT(RTDM, xnsched_root_p()))
-               return;
-
        trace_cobalt_driver_task_join(task);
 
        xnthread_join(task, true);
 }
 
-EXPORT_SYMBOL_GPL(rtdm_task_join_nrt);
+EXPORT_SYMBOL_GPL(rtdm_task_join);
 
 /**
  * @brief Busy-wait a specified amount of time
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index f4e665e..69b454f 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -1452,7 +1452,7 @@ unlock_and_exit:
 EXPORT_SYMBOL_GPL(xnthread_cancel);
 
 /**
- * @fn void xnthread_join(struct xnthread *thread)
+ * @fn void xnthread_join(struct xnthread *thread, bool uninterruptible)
  * @brief Join with a terminated thread.
  *
  * This service waits for @a thread to terminate after a call to
@@ -1465,6 +1465,9 @@ EXPORT_SYMBOL_GPL(xnthread_cancel);
  *
  * @param thread The descriptor address of the thread to join with.
  *
+ * @param uninterruptible Boolean telling whether the service should
+ * wait for completion uninterruptible if called from secondary mode.
+ *
  * @return 0 is returned on success. Otherwise, the following error
  * codes indicate the cause of the failure:
  *
diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index d945be7..8adb69e 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -563,7 +563,7 @@ static void rtswitch_close(struct rtdm_fd *fd)
 
                        if (task->base.flags & RTSWITCH_KERNEL) {
                                rtdm_task_destroy(&task->ktask);
-                               rtdm_task_join_nrt(&task->ktask, 0);
+                               rtdm_task_join(&task->ktask);
                        }
                        rtdm_event_destroy(&task->rt_synch);
                }


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

Reply via email to