mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user