* dcrt0.cc (_dll_crt0): Add some stern internal errors.

This commit is contained in:
Christopher Faylor 2004-02-24 17:13:16 +00:00
parent 3d7e5e901f
commit 5dbaca1607
3 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2004-02-24 Christopher Faylor <cgf@redhat.com>
* dcrt0.cc (_dll_crt0): Add some stern internal errors.
2004-02-24 Corinna Vinschen <corinna@vinschen.de> 2004-02-24 Corinna Vinschen <corinna@vinschen.de>
* thread.cc (pthread::cancelable_wait): Rearrange slightly. * thread.cc (pthread::cancelable_wait): Rearrange slightly.

View File

@ -910,12 +910,18 @@ extern "C" void __stdcall
_dll_crt0 () _dll_crt0 ()
{ {
extern HANDLE sync_startup; extern HANDLE sync_startup;
if (sync_startup) if (!sync_startup)
system_printf ("internal error: sync_startup not called at start. Expect signal problems.");
else
{ {
(void) WaitForSingleObject (sync_startup, INFINITE); (void) WaitForSingleObject (sync_startup, INFINITE);
CloseHandle (sync_startup); CloseHandle (sync_startup);
} }
extern unsigned threadfunc_ix;
if (!threadfunc_ix)
system_printf ("internal error: couldn't determine location of thread function on stack. Expect signal problems.");
main_environ = user_data->envptr; main_environ = user_data->envptr;
*main_environ = NULL; *main_environ = NULL;

View File

@ -17,7 +17,7 @@ details. */
int NO_COPY dynamically_loaded; int NO_COPY dynamically_loaded;
static char *search_for = (char *) cygthread::stub; static char *search_for = (char *) cygthread::stub;
static unsigned threadfunc_ix __attribute__((section ("cygwin_dll_common"), shared)) = 0; unsigned threadfunc_ix __attribute__((section ("cygwin_dll_common"), shared)) = 0;
DWORD tls_func; DWORD tls_func;
HANDLE sync_startup; HANDLE sync_startup;