From 2b6d15a90833dd2e3aa2aa758813e721fe94a0ca Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 6 Dec 2003 18:08:38 +0000 Subject: * cygtls.h: Add more "don't parse this" guards. (_threadinfo::init_thread): Rename from 'init'. (_threadinfo::init): Declare new function. (_threadinfo::protect_linked_list): Declare new critical section. * dcrt0.cc (dll_crt0_1): Call init_thread to initialize thread stuff. (_dll_crt0): Call _threadinfo::init prior to invoking dll_crt0_1. * exceptions.cc (_threadinfo::init_thread): Rename from 'init'. (_threadinfo::init): Define new function. Protect linked list manipulation with new critical section. (_threadinfo::call): Reflect function name change. (_threadinfo::remove): Protect linked list manipulation with new critical section * gentls_offsets: Rework to allow multi-line "don't parse this" protection. * init.cc (dll_entry): Don't remove threads info stuff here since the remove function uses a critical section which can't be used during thread creation or destruction. * thread.cc (pthread::exit): Call _threadinfo remove function here. --- winsup/cygwin/dcrt0.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/dcrt0.cc') diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a0af0231b..575a2bacb 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -534,7 +534,7 @@ dll_crt0_1 () { char padding[CYGTLS_PADSIZE]; _main_tls = &_my_tls; - _main_tls->init (padding); + _main_tls->init_thread (padding); /* According to onno@stack.urc.tue.nl, the exception handler record must be on the stack. */ @@ -901,6 +901,8 @@ _dll_crt0 () break; } } + + _threadinfo::init (); dll_crt0_1 (); } -- cgit v1.2.3