From d1eb7a4615a95da05f4bbc2e93e167b8afe6f0dc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 3 Dec 2003 05:21:55 +0000 Subject: * cygthread.cc (cygthread::stub): Properly establish _threadinfo environment. (cygthread::stub2): New function. (cygthread::simplestub): Ditto. (cygthread::simplestub2): New function. * cygthread.h (cygthread::stub2): Declare new function. (cygthread::simplestub2): Ditto. * cygtls.h (_threadinfo::call): Declare new function. (_threadinfo::call2): Ditto. * dcrt0.cc (dll_crt0_1): Accommodate new _threadinfo::init which doesn't return pointer to tls. (_dll_crt0): Remove obsolete DECLARE_TLS_STORAGE. (dll_crt0): Ditto. * exceptions.cc (_threadinfo::call): New function. (_threadinfo::call2): Ditto. (_threadinfo::init): Don't return pointer. * thread.cc (pthread::thread_init_wrapper): Properly establish _threadinfo environment. (pthread::thread_init_wrapper2): New function. * thread.h (pthread::thread_init_wrapper): Remove noreturn attribute (pthread::thread_init_wrapper2): Declare new function. * winbase.h: Remove obsolete code. --- winsup/cygwin/thread.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/thread.cc') 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) { -- cgit v1.2.3