libc: Add debug assert to prevent tls allocation failure

So It's easy to find TASK_TLS_ELEM not enough error.

Signed-off-by: zhangbo56 <zhangbo56@xiaomi.com>
This commit is contained in:
zhangbo56 2024-05-31 12:05:34 +08:00 committed by Xiang Xiao
parent 05ba822c41
commit 0496984338
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#include <nuttx/tls.h>
#include <nuttx/mutex.h>
#include <assert.h>
/****************************************************************************
* Private Data
@ -104,6 +105,9 @@ int task_tls_alloc(tls_dtor_t dtor)
}
nxmutex_unlock(&g_tlslock);
DEBUGASSERT(ret != -EUSERS);
return ret;
}