hartmannathan commented on code in PR #19982:
URL: https://github.com/apache/nuttx/pull/19982#discussion_r3891145835


##########
libs/libc/wqueue/work_cancel.c:
##########
@@ -57,53 +58,78 @@
  *   Zero (OK) on success, a negated errno on failure.  This error may be
  *   reported:
  *
- *   -ENOENT - There is no such work queued.
  *   -EINVAL - An invalid work queue was specified
  *
  ****************************************************************************/
 
-static int work_qcancel(FAR struct usr_wqueue_s *wqueue,
+static int work_qcancel(FAR struct usr_wqueue_s *wqueue, bool sync,
                         FAR struct work_s *work)
 {
-  int ret = -ENOENT;
-  int semcount;
+  pid_t self = gettid();
+  int ret;
 
-  DEBUGASSERT(work != NULL);
+  if (wqueue == NULL || work == NULL)
+    {
+      return -EINVAL;
+    }
 
-  /* Get exclusive access to the work queue */
+  for (; ; )

Review Comment:
   Suggestion: Maybe add a comment to explain this, so people who read the code 
later will have an easier time understanding it?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to