You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/05/28 16:05:46 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6337: Refine the implementation of TLS
xiaoxiang781216 commented on code in PR #6337:
URL: https://github.com/apache/incubator-nuttx/pull/6337#discussion_r884151374
##########
libs/libc/pthread/pthread_setspecific.c:
##########
@@ -72,9 +74,23 @@
int pthread_setspecific(pthread_key_t key, FAR const void *value)
{
- int ret = tls_set_value((int)key, (uintptr_t)value);
- return ret < 0 ? -ret : 0;
+ FAR struct tls_info_s *info;
+
+ DEBUGASSERT(key < CONFIG_TLS_NELEM);
+ if (key < CONFIG_TLS_NELEM)
Review Comment:
Ok, my editor direct me to the wrong definition(glibc version). All code check `key >= 0` now.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org