MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / pthread_create

Function pthread_create

vm/ByteCodeTranslator/src/malloc.c:169–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167#include <dlfcn.h>
168
169int
170pthread_create(pthread_t* thread,
171 const pthread_attr_t* attr,
172 void* (*start_routine)(void*),
173 void* arg) {
174#if defined(__linux__) || defined(__APPLE__)
175 char fname[] = "pthread_create";
176#else
177 char fname[] = "_pthread_create";
178#endif
179 void* real_pthread_create = dlsym(RTLD_NEXT, fname);
180 rpmalloc_thread_initialize();
181 thread_starter_arg* starter_arg = rpmalloc(sizeof(thread_starter_arg));
182 starter_arg->real_start = start_routine;
183 starter_arg->real_arg = arg;
184 return (*(int (*)(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*))real_pthread_create)(thread, attr, thread_starter, starter_arg);
185}
186
187#endif
188

Calls 2

rpmallocFunction · 0.85

Tested by

no test coverage detected