summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index cb99be031..a34cd8497 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -1885,14 +1885,10 @@ __reent_t::init_clib (struct _reent& var)
_clib = &var;
};
-/* Pthreads */
-void *
-pthread::thread_init_wrapper (void *_arg)
+void
+pthread::thread_init_wrapper2 (void *arg, void *)
{
- // Setup the local/global storage of this thread
- __uint64_t padding[CYGTLS_PADSIZE];
- pthread *thread = (pthread *) _arg;
- thread->cygtls = _my_tls.init (padding, &thread);
+ pthread *thread = (pthread *) arg;
_my_tls.tid = thread;
exception_list cygwin_except_entry;
@@ -1923,7 +1919,7 @@ pthread::thread_init_wrapper (void *_arg)
system_printf ("local storage for thread isn't setup correctly");
#endif
- thread_printf ("started thread %p %p %p %p %p %p", _arg, &local_clib,
+ thread_printf ("started thread %p %p %p %p %p %p", arg, &local_clib,
_impure_ptr, thread, thread->function, thread->arg);
// call the user's thread
@@ -1932,6 +1928,14 @@ pthread::thread_init_wrapper (void *_arg)
thread->exit (ret);
}
+/* Pthreads */
+void
+pthread::thread_init_wrapper (void *arg)
+{
+ // calls thread_init_wrapper2. Never returns.
+ _threadinfo::call (thread_init_wrapper2, arg);
+}
+
bool
pthread::is_good_object (pthread_t const *thread)
{