* 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.
This commit is contained in:
Christopher Faylor
2003-12-03 05:21:55 +00:00
parent af9ef8abb2
commit d1eb7a4615
9 changed files with 80 additions and 64 deletions

View File

@@ -15,6 +15,8 @@ details. */
#include "sync.h"
#include "cygerrno.h"
#include "sigproc.h"
#include "thread.h"
#include "cygtls.h"
#undef CloseHandle
@@ -30,13 +32,20 @@ bool NO_COPY cygthread::exiting;
DWORD WINAPI
cygthread::stub (VOID *arg)
{
DECLARE_TLS_STORAGE;
_threadinfo::call (stub2, arg);
return 0;
}
void
cygthread::stub2 (void *arg, void *)
{
exception_list except_entry;
/* Initialize this thread's ability to respond to things like
SIGSEGV or SIGFPE. */
init_exceptions (&except_entry);
cygthread *info = (cygthread *) arg;
if (info->arg == cygself)
{
@@ -91,7 +100,13 @@ cygthread::stub (VOID *arg)
DWORD WINAPI
cygthread::simplestub (VOID *arg)
{
DECLARE_TLS_STORAGE;
_threadinfo::call (simplestub2, arg);
return 0;
}
void
cygthread::simplestub2 (void *arg, void *)
{
exception_list except_entry;
/* Initialize this thread's ability to respond to things like