summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/thread.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-03 05:21:55 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-03 05:21:55 +0000
commitd1eb7a4615a95da05f4bbc2e93e167b8afe6f0dc (patch)
treec8259c647b2b6d0c356f01c8476268c2270dda51 /winsup/cygwin/thread.cc
parentaf9ef8abb2ad0423c20b28c5050a3b6e82d4e90c (diff)
downloadcygnal-d1eb7a4615a95da05f4bbc2e93e167b8afe6f0dc.tar.gz
cygnal-d1eb7a4615a95da05f4bbc2e93e167b8afe6f0dc.tar.bz2
cygnal-d1eb7a4615a95da05f4bbc2e93e167b8afe6f0dc.zip
* 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.
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)
{