TimJTi commented on issue #12629:
URL: https://github.com/apache/nuttx/issues/12629#issuecomment-2210987304

   > could you simplify your case and attach it to pr?
   
   @xiaoxiang781216  of course - it's here and I will copy to what I think is 
the offending PR. 
   
   This is is one thread:
   ```
   typedef struct
   {
     pid_t   pid;
     uint8_t signo;
   } notify_t;
   
   static notify_t g_notify[CONFIG_MAX_NEWDATA_SIGS];
   
   int newdata_notify(void *callback)
   {
     int ret;
     int idx = 0;
     struct sigaction act;
   
     while ((idx < CONFIG_MAX_NEWDATA_SIGS) &&  g_notify[idx].pid)
       {
         idx++;
       }
     if (idx >= CONFIG_MAX_NEWDATA_SIGS)
       {
         ret = -EINVAL;
         goto errout;
       }
   
     g_notify[idx].pid      = getpid();     // <-------------------- This 
returns 0 since the PR commit
     g_notify[idx].signo    = CONFIG_NEWDATA_SIGNO;
   
     /* then code to set up the required sigaction and error handling */
     return ret;
   }
   ```
   This is in another thread:
   
   `  ret = newdata_notify(callback_fn); `
   
   
   
   
   


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