diff options
author | Christopher Faylor <me@cgf.cx> | 2003-12-14 07:09:22 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-12-14 07:09:22 +0000 |
commit | c350feda2096e2446bf7cc0b97019eed7386400d (patch) | |
tree | cf4d16da61690609cc660b194d3b236d93ba0a40 /winsup/cygwin/thread.cc | |
parent | f082663050af4062e8fea5e3f56991794dcb0091 (diff) | |
download | cygnal-c350feda2096e2446bf7cc0b97019eed7386400d.tar.gz cygnal-c350feda2096e2446bf7cc0b97019eed7386400d.tar.bz2 cygnal-c350feda2096e2446bf7cc0b97019eed7386400d.zip |
* cygthread.cc (cygthread::stub): Revert previous change and again subsume
cygthread::stub2. Just return from function now since ExitThread is guaranteed
by automatic _threadinfo wrapper. Define as per ThreadProc convention.
(cygthread::stub2): Remove.
(cygthread::simplestub): Perform similar operations to cygthread::stub.
(cygthread::simplestub2): Remove.
* cygthread.h (cygthread::stub): Declare as per ThreadProc convention.
(cygthread::stub2): Remove declaration.
(cygthread::simplestub): Declare as per ThreadProc convention.
(cygthread::simplestub2): Remove declaration.
* cygtls.h (_threadinfo::call): Define first argument as per ThreadProc
convention.
(_threadinfo::call2): Ditto.
(_tlsbase): Define as char * pointer.
(_tlstop): New definition.
(_main_tls): Define here.
* dcrt0.cc (alloc_stack): Revert previous change which called init_thread since
information would be overwritten by fork later anyway.
(dll_crt0_1): Use _tlsbase and _tlstop for setting stack bottom, top.
* exceptions.cc: Move _main_tls declaration to cygtls.h.
(_threadinfo::call): Define first argument as per ThreadProc convention.
(_threadinfo::call2): Call ExitThread with thread function return value.
(_threadinfo::init_thread): Don't initialize cygtls to zero if input arg is
NULL.
* fork.cc (fork_child): Reset _main_tls here. Reinitialize parts of _my_tls
after copying data from parent.
* init.cc (threadfunc_fe): New function. Front-end for all threads created in
cygwin processes.
(munge_threadfunc): New function.
(dll_entry): Call munge_threadfunc to force the call of a thread wrapper.
* thread.cc (pthread::thread_init_wrapper): Perform similar operations to
cygthread::stub.
(pthread::thread_init_wrapper2): Remove.
* thread.h (pthread::thread_init_wrapper): Declare as per ThreadProc
convention.
(pthread::thread_init_wrapper2): Remove declaration.
* window.cc (Winmain): Just return from function now since ExitThread is
guaranteed by automatic _threadinfo wrapper.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r-- | winsup/cygwin/thread.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index b2ba543fe..93bf701ac 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -338,8 +338,8 @@ pthread::create (void *(*func) (void *), pthread_attr *newattr, arg = threadarg; win32_obj_id = ::CreateThread (&sec_none_nih, attr.stacksize, - (LPTHREAD_START_ROUTINE) thread_init_wrapper, - this, CREATE_SUSPENDED, &thread_id); + thread_init_wrapper, this, CREATE_SUSPENDED, + &thread_id); if (!win32_obj_id) { @@ -1887,8 +1887,8 @@ __reent_t::init_clib (struct _reent& var) _clib = &var; }; -void -pthread::thread_init_wrapper2 (void *arg, void *) +DWORD WINAPI +pthread::thread_init_wrapper (void *arg) { pthread *thread = (pthread *) arg; _my_tls.tid = thread; @@ -1928,14 +1928,8 @@ pthread::thread_init_wrapper2 (void *arg, void *) void *ret = thread->function (thread->arg); thread->exit (ret); -} -/* Pthreads */ -void -pthread::thread_init_wrapper (void *arg) -{ - // calls thread_init_wrapper2. Never returns. - _threadinfo::call (thread_init_wrapper2, arg); + return 0; // just for show. Never returns. } bool |