Fix-Point commented on code in PR #17556:
URL: https://github.com/apache/nuttx/pull/17556#discussion_r2630318261


##########
sched/wdog/wd_cancel.c:
##########
@@ -61,32 +61,37 @@
 int wd_cancel(FAR struct wdog_s *wdog)
 {
   irqstate_t flags;
-  bool head;
+  int ret   = -EINVAL;
+  bool head = false;
 
-  flags = spin_lock_irqsave(&g_wdspinlock);
+  if (wdog != NULL)
+    {
+      sched_note_wdog(NOTE_WDOG_CANCEL, (FAR void *)wdog->func,

Review Comment:
   > I'm not sure if you have taken note of the implementation of hrtimers in 
HaloOS. In particular, the core logic of the **hrtimer_queue** component is 
actually similar to that in HaloOS in terms of both naming and implementation:
   > 
   > 
https://gitee.com/haloos/vcos_kernel_nuttx/blob/master/sched/hrtimer/hrtimer_queue.h
   > 
   > This naming convention is not commonly adopted—for instance, the Linux 
kernel uses a different naming approach for equivalent functionality:
   > 
   > https://github.com/torvalds/linux/blob/master/include/linux/hrtimer.h
   > 
   > Additionally, I noticed your first commit was on December 1st, while 
@wangchdo commit was earlier, right?
   > 
   > <img alt="image" width="528" height="285" 
src="https://private-user-images.githubusercontent.com/758493/528013174-3eedeeca-ebcd-4d53-8ab1-0834834e5d7e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjYwNTEwODksIm5iZiI6MTc2NjA1MDc4OSwicGF0aCI6Ii83NTg0OTMvNTI4MDEzMTc0LTNlZWRlZWNhLWViY2QtNGQ1My04YWIxLTA4MzQ4MzRlNWQ3ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxOFQwOTM5NDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYmE0OGM1YTRmOGVmYTZkMzEyNzRlMzNkMDhlOWNlNmJjNmVjMzVhZjNlYzM3N2E3OGUzZWNlZGRlZGMxZjFhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yrSAQ7pU6EgGvUducdW6-ph530vEgwPMLl3ZmxCt9ak";>
   
   > The HRTimer Queue is a zero-performance-overhead, composable, and 
customizable abstraction that provides only asynchronous-style interfaces:
   - hrtimer_queue_start(queue, timer): Asynchronously sends an HRTimer to 
HRTimer queue.
   - hrtimer_queue_async_cancel(queue, timer): Asynchronously cancels an 
HRTimer and returns the current reference count of the timer.
   - hrtimer_queue_wait(queue, timer): Waits for the release of all references 
to the HRTimer to obtain ownership of the HRTimer data structure.
   
   
https://gitee.com/haloos/vcos_kernel_nuttx/blob/master/sched/hrtimer/hrtimer_queue.h
 This appears to be  a implementation of a literal queue based on a heap.
   
   I don't think these two `hrtimer_queue` have anything in common except for 
their names.



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