nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nuttx] patacongo commented on a change in pull request #734: Check return from nxsem_wait_uninterruptible()
Date Sun, 05 Apr 2020 17:18:49 GMT
patacongo commented on a change in pull request #734: Check return from nxsem_wait_uninterruptible()
URL: https://github.com/apache/incubator-nuttx/pull/734#discussion_r403731226
 
 

 ##########
 File path: arch/arm/src/cxd56xx/cxd56_sysctl.c
 ##########
 @@ -127,13 +164,24 @@ int cxd56_sysctlcmd(uint8_t id, uint32_t data)
   ret = cxd56_iccsend(CXD56_PROTO_SYSCTL, &msg, SYSCTL_TIMEOUT);
   if (ret < 0)
     {
+      sysctl_semgive(&g_exc);
       _err("Timeout.\n");
       return ret;
     }
 
   /* Wait for reply message from system CPU */
 
-  sysctl_semtake(&g_sync);
+  do
+    {
+      ret = sysctl_semtake(&g_sync);
+
+      /* The only expected error is ECANCELED which would occur if the
+       * calling thread were canceled.
+       */
+
+      DEBUGASSERT(ret == OK || ret == -ECANCELED);
+    }
+  while (ret < 0);
 
 Review comment:
   It there any reason for this loop here?  This loop basically ignores cancellation requests
(and loses the cancellation status permanently).  Why can't you just return following the
same logic as at lines 167-169.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message