[rtems commit] cpukit/posix/src/timertsr.c: Add _Assert()

Joel Sherril joel at rtems.org
Wed Nov 26 13:55:51 UTC 2014


Module:    rtems
Branch:    master
Commit:    e106aa73802c95ee2c6b72bcec8830f4b29d6e9b
Changeset: http://git.rtems.org/rtems/commit/?id=e106aa73802c95ee2c6b72bcec8830f4b29d6e9b

Author:    Josh Oguin <josh.oguin at oarcorp.com>
Date:      Wed Nov 19 14:44:54 2014 -0600

cpukit/posix/src/timertsr.c: Add _Assert()

CodeSonar flagged this as an empty if body. Upon analysis, it turned
out to be an error that we think should never occur but if it did,
there is nothing we could do about it. It would likely just indicate
the thread was deleted before we got here. Adding the _Assert() at least
will flag this if it ever occurs during a debug build and we can discuss
what happened.

---

 cpukit/posix/src/timertsr.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cpukit/posix/src/timertsr.c b/cpukit/posix/src/timertsr.c
index fbbdf59..8555463 100644
--- a/cpukit/posix/src/timertsr.c
+++ b/cpukit/posix/src/timertsr.c
@@ -73,7 +73,14 @@ void _POSIX_Timer_TSR(
    */
 
   if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) {
-    /* XXX error handling */
+    _Assert( FALSE );
+    /*
+     * TODO: What if an error happens at run-time? This should never
+     *       occur because the timer should be canceled if the thread
+     *       is deleted. This method is being invoked from the Clock
+     *       Tick ISR so even if we decide to take action on an error,
+     *       we don't have many options. We shouldn't shut the system down.
+     */
   }
 
   /* After the signal handler returns, the count of expirations of the



More information about the vc mailing list