<div dir="ltr">seems good</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 20, 2021 at 2:36 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Return STATUS_DEADLOCK (RTEMS_INCORRECT_STATE) to indicate a nested<br>
seize since this is a kind of deadlock. This status code is also used<br>
for other deadlocks.<br>
<br>
Update #4217.<br>
---<br>
cpukit/include/rtems/score/mrspimpl.h | 30 +++++++++++++++++----------<br>
testsuites/smptests/smpmrsp01/init.c | 2 +-<br>
2 files changed, 20 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/cpukit/include/rtems/score/mrspimpl.h b/cpukit/include/rtems/score/mrspimpl.h<br>
index be4a934436..4af7d0311d 100644<br>
--- a/cpukit/include/rtems/score/mrspimpl.h<br>
+++ b/cpukit/include/rtems/score/mrspimpl.h<br>
@@ -391,18 +391,26 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Wait_for_ownership(<br>
}<br>
<br>
/**<br>
- * @brief Seizes the MrsP control.<br>
+ * @brief Seizes the MrsP mutex.<br>
*<br>
- * @param[in, out] mrsp The MrsP control to seize the control of.<br>
- * @param[in, out] executing The currently executing thread.<br>
- * @param wait Indicates whether the calling thread is willing to wait.<br>
- * @param queue_context The thread queue context.<br>
+ * @param[in, out] mrsp is the MrsP mutex to seize.<br>
*<br>
- * @retval STATUS_SUCCESSFUL The operation succeeded.<br>
- * @retval STATUS_MUTEX_CEILING_VIOLATED The wait priority of the executing<br>
- * thread exceeds the ceiling priority.<br>
- * @retval STATUS_UNAVAILABLE The executing thread is already the owner of<br>
- * the MrsP control. Seizing it is not possible.<br>
+ * @param[in, out] executing is the currently executing thread.<br>
+ *<br>
+ * @param wait shall be true, if the executing thread is willing to wait,<br>
+ * otherwise it shall be false.<br>
+ *<br>
+ * @param[in, out] queue_context is the thread queue context.<br>
+ *<br>
+ * @retval STATUS_SUCCESSFUL The requested operation was successful.<br>
+ *<br>
+ * @retval STATUS_UNAVAILABLE Seizing the mutex was not immmediately possible.<br>
+ *<br>
+ * @retval STATUS_DEADLOCK The executing thread was already the owner of<br>
+ * the mutex.<br>
+ *<br>
+ * @retval STATUS_MUTEX_CEILING_VIOLATED The current priority of the executing<br>
+ * thread exceeds the ceiling priority of the mutex.<br>
*/<br>
RTEMS_INLINE_ROUTINE Status_Control _MRSP_Seize(<br>
MRSP_Control *mrsp,<br>
@@ -422,7 +430,7 @@ RTEMS_INLINE_ROUTINE Status_Control _MRSP_Seize(<br>
status = _MRSP_Claim_ownership( mrsp, executing, queue_context );<br>
} else if ( owner == executing ) {<br>
_MRSP_Release( mrsp, queue_context );<br>
- status = STATUS_UNAVAILABLE;<br>
+ status = STATUS_DEADLOCK;<br>
} else if ( wait ) {<br>
status = _MRSP_Wait_for_ownership( mrsp, executing, queue_context );<br>
} else {<br>
diff --git a/testsuites/smptests/smpmrsp01/init.c b/testsuites/smptests/smpmrsp01/init.c<br>
index da3426ee00..11535763ca 100644<br>
--- a/testsuites/smptests/smpmrsp01/init.c<br>
+++ b/testsuites/smptests/smpmrsp01/init.c<br>
@@ -765,7 +765,7 @@ static void test_mrsp_nested_obtain_error(test_context *ctx)<br>
rtems_test_assert(sc == RTEMS_SUCCESSFUL);<br>
<br>
sc = rtems_semaphore_obtain(id, RTEMS_WAIT, RTEMS_NO_TIMEOUT);<br>
- rtems_test_assert(sc == RTEMS_UNSATISFIED);<br>
+ rtems_test_assert(sc == RTEMS_INCORRECT_STATE);<br>
<br>
sc = rtems_semaphore_release(id);<br>
rtems_test_assert(sc == RTEMS_SUCCESSFUL);<br>
-- <br>
2.26.2<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>