* thread.h (pthread::init_mainthread): Remove function parameter.
(MTinterface::Init): Ditto. * thread.cc (MTinterface::Init): Remove function parameter. Always initialize reent_key. (pthread::init_mainthread): Remove function parameter. (MTinterface::fixup_after_fork): Fix pthread::init_mainthread call. * dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and pthread::init_mainthread. Call pthread::init_mainthread only when not forked.
This commit is contained in:
parent
ac5e8cb29c
commit
c8fa3426af
|
@ -1,3 +1,15 @@
|
||||||
|
2003-05-15 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
|
* thread.h (pthread::init_mainthread): Remove function parameter.
|
||||||
|
(MTinterface::Init): Ditto.
|
||||||
|
* thread.cc (MTinterface::Init): Remove function parameter.
|
||||||
|
Always initialize reent_key.
|
||||||
|
(pthread::init_mainthread): Remove function parameter.
|
||||||
|
(MTinterface::fixup_after_fork): Fix pthread::init_mainthread call.
|
||||||
|
* dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and
|
||||||
|
pthread::init_mainthread.
|
||||||
|
Call pthread::init_mainthread only when not forked.
|
||||||
|
|
||||||
2003-05-15 Corinna Vinschen <corinna@vinschen.de>
|
2003-05-15 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_proc.cc (format_proc_meminfo): Make swap memory output
|
* fhandler_proc.cc (format_proc_meminfo): Make swap memory output
|
||||||
|
|
|
@ -565,7 +565,7 @@ dll_crt0_1 ()
|
||||||
_impure_ptr = &reent_data;
|
_impure_ptr = &reent_data;
|
||||||
|
|
||||||
user_data->resourcelocks->Init ();
|
user_data->resourcelocks->Init ();
|
||||||
user_data->threadinterface->Init (user_data->forkee);
|
user_data->threadinterface->Init ();
|
||||||
|
|
||||||
mainthread.init ("mainthread"); // For use in determining if signals
|
mainthread.init ("mainthread"); // For use in determining if signals
|
||||||
// should be blocked.
|
// should be blocked.
|
||||||
|
@ -631,7 +631,10 @@ dll_crt0_1 ()
|
||||||
ProtectHandle (hMainThread);
|
ProtectHandle (hMainThread);
|
||||||
cygthread::init ();
|
cygthread::init ();
|
||||||
|
|
||||||
pthread::init_mainthread (!user_data->forkee);
|
/* Initialize pthread mainthread when not forked and it is save to call new,
|
||||||
|
otherwise it is reinitalized in fixup_after_fork */
|
||||||
|
if (!user_data->forkee)
|
||||||
|
pthread::init_mainthread ();
|
||||||
|
|
||||||
/* Initialize debug muto, if DLL is built with --enable-debugging.
|
/* Initialize debug muto, if DLL is built with --enable-debugging.
|
||||||
Need to do this before any helper threads start. */
|
Need to do this before any helper threads start. */
|
||||||
|
|
|
@ -188,14 +188,12 @@ ResourceLocks::Delete ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MTinterface::Init (int forked)
|
MTinterface::Init ()
|
||||||
{
|
{
|
||||||
reents._clib = _impure_ptr;
|
reents._clib = _impure_ptr;
|
||||||
reents._winsup = &winsup_reent;
|
reents._winsup = &winsup_reent;
|
||||||
winsup_reent._process_logmask = LOG_UPTO (LOG_DEBUG);
|
winsup_reent._process_logmask = LOG_UPTO (LOG_DEBUG);
|
||||||
|
reent_key.set (&reents);
|
||||||
if (!forked)
|
|
||||||
reent_key.set (&reents);
|
|
||||||
|
|
||||||
pthread_mutex::init_mutex ();
|
pthread_mutex::init_mutex ();
|
||||||
pthread_cond::init_mutex ();
|
pthread_cond::init_mutex ();
|
||||||
|
@ -215,7 +213,7 @@ MTinterface::fixup_after_fork (void)
|
||||||
pthread_key::fixup_after_fork ();
|
pthread_key::fixup_after_fork ();
|
||||||
|
|
||||||
threadcount = 1;
|
threadcount = 1;
|
||||||
pthread::init_mainthread (true);
|
pthread::init_mainthread ();
|
||||||
|
|
||||||
pthread_mutex::fixup_after_fork ();
|
pthread_mutex::fixup_after_fork ();
|
||||||
pthread_cond::fixup_after_fork ();
|
pthread_cond::fixup_after_fork ();
|
||||||
|
@ -227,11 +225,8 @@ MTinterface::fixup_after_fork (void)
|
||||||
|
|
||||||
/* static methods */
|
/* static methods */
|
||||||
void
|
void
|
||||||
pthread::init_mainthread (bool do_init)
|
pthread::init_mainthread ()
|
||||||
{
|
{
|
||||||
if (!do_init)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pthread *thread = get_tls_self_pointer ();
|
pthread *thread = get_tls_self_pointer ();
|
||||||
if (!thread)
|
if (!thread)
|
||||||
{
|
{
|
||||||
|
|
|
@ -401,7 +401,7 @@ public:
|
||||||
pthread ();
|
pthread ();
|
||||||
virtual ~pthread ();
|
virtual ~pthread ();
|
||||||
|
|
||||||
static void init_mainthread (bool);
|
static void init_mainthread ();
|
||||||
static bool is_good_object(pthread_t const *);
|
static bool is_good_object(pthread_t const *);
|
||||||
static void atforkprepare();
|
static void atforkprepare();
|
||||||
static void atforkparent();
|
static void atforkparent();
|
||||||
|
@ -679,7 +679,7 @@ public:
|
||||||
pthread_key reent_key;
|
pthread_key reent_key;
|
||||||
pthread_key thread_self_key;
|
pthread_key thread_self_key;
|
||||||
|
|
||||||
void Init (int);
|
void Init ();
|
||||||
void fixup_before_fork (void);
|
void fixup_before_fork (void);
|
||||||
void fixup_after_fork (void);
|
void fixup_after_fork (void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue