szafonimateusz-mi opened a new pull request, #17130:
URL: https://github.com/apache/nuttx/pull/17130

   ## Summary
   
   Previously sigpending() returned all pending signals in the group, which is 
not POSIX compliant. It should return signals pending only for the caller, so a 
signal send with pthread_kill() intended for another thread should not be 
returned (it's not pending for a caller).
   
   This fixes the pthread_create.c/test9 test case from PSE52 Open Group 
Threads Test Suite.
   
   ## Impact
   
   POSIX compliance
   
   ## Testing
   
   PSE52 test suite.
   
   The test case looks like this:
   
   ```
   function test():
       setup_signals()       // block signals, set SIGTERM handler
   
       start thread1
       join thread1
   
       restore_signals()     // restore original signal mask and handler
   
   ------------------------------
   thread1 ():
       block all signals
       send SIGTERM to self   // signal becomes pending
   
       start thread2
       join thread2           // thread2 checks pending signals (should be none)
   
       unblock all signals    // pending SIGTERM is delivered
       return
   
   ------------------------------
   thread2 ():
       get pending signals
       for each signal:
           if signal is pending:
               mark fail      // there should be no pending signals for 
thread2, NuttX fails here
       return
   ```


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