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


##########
sched/signal/sig_notification.c:
##########
@@ -70,7 +74,22 @@ static void nxsig_notification_worker(FAR void *arg)
 
   /* Perform the callback */
 
-  work->func(work->value);
+#ifdef CONFIG_FDPIC
+  /* The worker does not carry the module's data base.  Install the base
+   * captured at registration around the call.  A zero base means the
+   * callback is not a module's.
+   */
+
+  if (work->got != 0)
+    {
+      fdpic_invoke((uintptr_t)work->value.sival_ptr, (uintptr_t)work->func,

Review Comment:
   why not call fdpic_callback to wrap the callback with got at register 
site?like other change?



##########
sched/timer/timer_create.c:
##########
@@ -196,6 +200,18 @@ int timer_create(clockid_t clockid, FAR struct sigevent 
*evp,
               /* Yes, copy the entire struct sigevent content */
 
               memcpy(&ret->pt_event, evp, sizeof(struct sigevent));
+
+#if defined(CONFIG_FDPIC) && defined(CONFIG_SIG_EVTHREAD)
+              /* Capture the module's data base while this runs in its
+               * context.  The callback fires later on a worker that has
+               * none.
+               */
+
+              ret->pt_work.got =
+                (fdpic_base() != 0 &&

Review Comment:
   why not  save fdpic_base  directly



##########
sched/mqueue/mq_notify.c:
##########
@@ -156,6 +160,17 @@ int mq_notify(mqd_t mqdes, FAR const struct sigevent 
*notification)
                  sizeof(struct sigevent));
 
           msgq->ntpid = rtcb->pid;
+
+#if defined(CONFIG_FDPIC) && defined(CONFIG_SIG_EVTHREAD)
+          /* Capture the module's data base while this runs in its
+           * context.  The callback fires later on a worker that has none.
+           */
+
+          msgq->ntwork.got =
+            (fdpic_base() != 0 &&
+             (notification->sigev_notify & SIGEV_THREAD) != 0) ?

Review Comment:
   remove all check



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