On 14/11/2019 21:44, Joel Sherrill wrote:
+bool _TOD_Hook_Register(
+  TOD_Hook *hook
+)
+{
+  ISR_lock_Context lock_context;
+
+  /*
+   * At this time, this method does NOT have a Classic or POSIX API
+   * that exports it. Any use of this method will be a direct call.
+   * It should only be called while NOT holding the TOD lock.
+   */
+  _Assert( !_TOD_Is_owner() );
+
+  if ( hook == NULL ) {
+    return FALSE;
+  }
+
+  _TOD_Lock();
+  _TOD_Acquire( &lock_context );
+  _Chain_Append_unprotected( &_TOD_Hooks, &hook->Node );
+  _TOD_Unlock();
+  return true;
+}

Where is the _TOD_Release()? This function should not test for a NULL hook and return void. Such kind of error handling should be done by upper layer functions and not at the lowest level.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to