mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
tls: Move pthread key destructor to libc
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
@@ -530,14 +530,6 @@ struct task_group_s
|
||||
FAR struct join_s *tg_jointail; /* Tail of a list of join data */
|
||||
#endif
|
||||
|
||||
/* Thread local storage ***************************************************/
|
||||
|
||||
#if CONFIG_TLS_NELEM > 0
|
||||
tls_ndxset_t tg_tlsset; /* Set of TLS indexes allocated */
|
||||
|
||||
tls_dtor_t tg_tlsdestr[CONFIG_TLS_NELEM]; /* List of TLS destructors */
|
||||
#endif
|
||||
|
||||
/* POSIX Signal Control Fields ********************************************/
|
||||
|
||||
sq_queue_t tg_sigactionq; /* List of actions for signals */
|
||||
|
||||
@@ -118,6 +118,13 @@ struct task_info_s
|
||||
struct tls_info_s ta_tls; /* Must be first field */
|
||||
#ifndef CONFIG_BUILD_KERNEL
|
||||
struct getopt_s ta_getopt; /* Globals used by getopt() */
|
||||
#endif
|
||||
/* Thread local storage ***************************************************/
|
||||
|
||||
#if CONFIG_TLS_NELEM > 0
|
||||
sem_t ta_tlssem;
|
||||
tls_ndxset_t ta_tlsset; /* Set of TLS index allocated */
|
||||
tls_dtor_t ta_tlsdtor[CONFIG_TLS_NELEM]; /* List of TLS destructors */
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -320,4 +327,20 @@ void tls_destruct(void);
|
||||
|
||||
FAR struct task_info_s *task_get_info(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: task_setup_info
|
||||
*
|
||||
* Description:
|
||||
* Setup task_info_s for task
|
||||
*
|
||||
* Input Parameters:
|
||||
* info - New created task_info_s
|
||||
*
|
||||
* Returned Value:
|
||||
* OK on success; ERROR on failure
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int task_setup_info(FAR struct task_info_s *info);
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_TLS_H */
|
||||
|
||||
@@ -294,14 +294,6 @@ SYSCALL_LOOKUP(telldir, 1)
|
||||
SYSCALL_LOOKUP(shmdt, 1)
|
||||
#endif
|
||||
|
||||
#if CONFIG_TLS_NELEM > 0
|
||||
SYSCALL_LOOKUP(tls_alloc, 0)
|
||||
SYSCALL_LOOKUP(tls_free, 1)
|
||||
SYSCALL_LOOKUP(tls_get_set, 1)
|
||||
SYSCALL_LOOKUP(tls_get_dtor, 1)
|
||||
SYSCALL_LOOKUP(tls_set_dtor, 2)
|
||||
#endif
|
||||
|
||||
/* The following are defined if pthreads are enabled */
|
||||
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
|
||||
Reference in New Issue
Block a user