MCPcopy Create free account
hub / github.com/apache/nuttx / pthread_tcb_setup

Function pthread_tcb_setup

sched/pthread/pthread_create.c:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 ****************************************************************************/
89
90static inline void pthread_tcb_setup(FAR struct tcb_s *ptcb,
91 FAR struct tcb_s *parent,
92 pthread_trampoline_t trampoline,
93 pthread_addr_t arg)
94{
95 FAR struct pthread_entry_s *entry;
96#if CONFIG_TASK_NAME_SIZE > 0
97 /* Copy the pthread name into the TCB */
98
99 strlcpy(ptcb->name, parent->name, CONFIG_TASK_NAME_SIZE);
100#endif /* CONFIG_TASK_NAME_SIZE */
101
102 /* For pthreads, args are strictly pass-by-value; that actual
103 * type wrapped by pthread_addr_t is unknown.
104 */
105
106 entry = (FAR struct pthread_entry_s *)(ptcb + 1);
107 entry->trampoline = trampoline;
108 entry->arg = arg;
109}
110
111/****************************************************************************
112 * Name: pthread_start

Callers 1

nx_pthread_createFunction · 0.85

Calls 1

strlcpyFunction · 0.50

Tested by

no test coverage detected