patacongo commented on pull request #3170:
URL: https://github.com/apache/incubator-nuttx/pull/3170#issuecomment-806160802


   
   >     * what if `_getoptvars` is called simultaneously due to two tasks 
calling getopt() at the same time? maybe this should be protected by a mutex?
   
   Good catch... mutex protection added
   
   >     * can we explicitly reserve space for this TLS data? if we continue to 
use this procedure (or the user requests too much TLS data) pthread_key_create 
will fail which leads to hard-to-debug problems. Having to guess the right size 
of `CONFIG_TLS_NELEM` is quite cumbersome. I think that we could have the array 
be CONFIG_TLS_NELEM + TLS_NELEM_RESERVED to guarantee this never fails.
   
   I like your idea to make the TLS data grow dynamically.  That is probably a 
different PR, however.  This logic uses only a single slot so I don't think it 
is an issue for this change. 
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to