- if (suspended) {
- (void)thread_set_state(_pthread_kernel_thread(thread), flavor, (thread_state_t)&state, count);
- if (needresume) {
- (void)thread_resume(_pthread_kernel_thread(thread));
- }
- } else {
- mach_port_t kernel_thread;
- (void)thread_create_running(mach_task_self(), flavor, (thread_state_t)&state, count, &kernel_thread);
- _pthread_set_kernel_thread(thread, kernel_thread);
- }
-}
-
-// pthread_setup initializes large structures to 0, which the compiler turns into a library call to memset. To avoid linking against
-// Libc, provide a simple wrapper that calls through to the libplatform primitives
-
-#undef memset
-__attribute__((visibility("hidden"))) void *
-memset(void *b, int c, size_t len)
-{
- return _platform_memset(b, c, len);
-}
-
-#undef bzero
-__attribute__((visibility("hidden"))) void
-bzero(void *s, size_t n)
-{
- _platform_bzero(s, n);
+ (void)thread_set_state(_pthread_kernel_thread(thread), flavor, (thread_state_t)&state, count);