MCPcopy Create free account
hub / github.com/F-Stack/f-stack / thread_start_wrapper

Function thread_start_wrapper

dpdk/lib/eal/unix/rte_thread.c:92–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91#ifndef RTE_EAL_PTHREAD_ATTR_SETAFFINITY_NP
92static void *
93thread_start_wrapper(void *arg)
94{
95 struct thread_start_context *ctx = (struct thread_start_context *)arg;
96 rte_thread_func thread_func = ctx->thread_func;
97 void *thread_args = ctx->thread_args;
98 int ret = 0;
99
100 if (ctx->thread_attr != NULL && CPU_COUNT(&ctx->thread_attr->cpuset) > 0) {
101 ret = rte_thread_set_affinity_by_id(rte_thread_self(), &ctx->thread_attr->cpuset);
102 if (ret != 0)
103 RTE_LOG(DEBUG, EAL, "rte_thread_set_affinity_by_id failed\n");
104 }
105
106 pthread_mutex_lock(&ctx->wrapper_mutex);
107 ctx->wrapper_ret = ret;
108 ctx->wrapper_done = true;
109 pthread_cond_signal(&ctx->wrapper_cond);
110 pthread_mutex_unlock(&ctx->wrapper_mutex);
111
112 if (ret != 0)
113 return NULL;
114
115 return (void *)(uintptr_t)thread_func(thread_args);
116}
117#endif
118
119int

Callers

nothing calls this directly

Calls 4

pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
rte_thread_selfFunction · 0.70

Tested by

no test coverage detected