xiaoxiang781216 commented on code in PR #16545:
URL: https://github.com/apache/nuttx/pull/16545#discussion_r2153580566


##########
sched/wqueue/kwork_thread.c:
##########
@@ -311,6 +311,7 @@ static int work_thread_create(FAR const char *name, int 
priority,
   char arg1[32];
   int wndx;
   int pid;
+  struct kworker_s *worker = wq_get_worker(wqueue);

Review Comment:
   ditto move before line 309



##########
sched/wqueue/kwork_thread.c:
##########
@@ -504,6 +505,7 @@ int work_queue_free(FAR struct kwork_wqueue_s *wqueue)
 
 int work_queue_priority_wq(FAR struct kwork_wqueue_s *wqueue)
 {
+  struct kworker_s *worker;

Review Comment:
   ditto



##########
sched/wqueue/wqueue.h:
##########
@@ -48,6 +48,13 @@
 #define HPWORKNAME "hpwork"
 #define LPWORKNAME "lpwork"
 
+/* Get the worker structure from the work queue.
+ * This function requires the workers are located next to the wqueue.
+ */
+
+#define wq_get_worker(wq) \
+  (struct kworker_s *)((char *)(wq) + sizeof(struct kwork_wqueue_s))

Review Comment:
   FAR



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to