patacongo commented on issue #9695:
URL: https://github.com/apache/nuttx/issues/9695#issuecomment-1620709469

   > It is only valid for FLAT build as there is only one version of a libc and 
there is no way to track if libc API is called by the kernel vs application 
layer. Some time ago I spent time thinking about a possible solution, but that 
ended up with nothing.
   
   It seems to me that is not valid in any build configuration.  If the 
internal nxmutex_lock implementation loops until the return is no -ECANCEL on 
an nested cancellation point, then an infinite loop will always be generated 
100% of the time.  I would not call that "valid" under any configuration.
   
   There is a way ... just call nxsem_wait() instead of sem_wait().  
nxsem_wait() is identical EXCEPT that it is not a cancellation point and, 
hence, will not generate the infinite loop.  You can call nxsem_wait() from 
nxmutex_lock() in all build configurations (provided that the syscall is made 
available).
   
   This is a regression that was introduced when the mutex stuff was put in.


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