* thread.h (pthread::init_mainthread): Add parameter forked. Set forked
default to false.. * thread.cc (MTinterface::fixup_after_fork): Call pthread::init_mainthread with forked = true. (pthread::init_mainthread): Add parameter forked. Do not change thread self pointer when forked.
This commit is contained in:
parent
cacc0d4421
commit
c83bdbf65e
@ -1,3 +1,12 @@
|
|||||||
|
2004-03-30 Thomas Pfaff <tpfaff@gmx.net>
|
||||||
|
|
||||||
|
* thread.h (pthread::init_mainthread): Add parameter forked. Set
|
||||||
|
forked default to false..
|
||||||
|
* thread.cc (MTinterface::fixup_after_fork): Call
|
||||||
|
pthread::init_mainthread with forked = true.
|
||||||
|
(pthread::init_mainthread): Add parameter forked. Do not change thread
|
||||||
|
self pointer when forked.
|
||||||
|
|
||||||
2004-03-30 Corinna Vinschen <corinna@vinschen.de>
|
2004-03-30 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* shm.cc (shmat): If shmid is unknown, call a special variation
|
* shm.cc (shmat): If shmid is unknown, call a special variation
|
||||||
|
@ -153,7 +153,7 @@ MTinterface::fixup_after_fork (void)
|
|||||||
pthread_key::fixup_after_fork ();
|
pthread_key::fixup_after_fork ();
|
||||||
|
|
||||||
threadcount = 0;
|
threadcount = 0;
|
||||||
pthread::init_mainthread ();
|
pthread::init_mainthread (true);
|
||||||
|
|
||||||
pthread::fixup_after_fork ();
|
pthread::fixup_after_fork ();
|
||||||
pthread_mutex::fixup_after_fork ();
|
pthread_mutex::fixup_after_fork ();
|
||||||
@ -166,14 +166,19 @@ MTinterface::fixup_after_fork (void)
|
|||||||
|
|
||||||
/* static methods */
|
/* static methods */
|
||||||
void
|
void
|
||||||
pthread::init_mainthread ()
|
pthread::init_mainthread (const bool forked)
|
||||||
{
|
{
|
||||||
pthread *thread = get_tls_self_pointer ();
|
pthread *thread = get_tls_self_pointer ();
|
||||||
if (!thread)
|
if (!thread)
|
||||||
{
|
{
|
||||||
thread = new pthread ();
|
if (forked)
|
||||||
if (!thread)
|
thread = pthread_null::get_null_pthread ();
|
||||||
api_fatal ("failed to create mainthread object");
|
else
|
||||||
|
{
|
||||||
|
thread = new pthread ();
|
||||||
|
if (!thread)
|
||||||
|
api_fatal ("failed to create mainthread object");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
thread->cygtls = &_my_tls;
|
thread->cygtls = &_my_tls;
|
||||||
|
@ -373,7 +373,7 @@ public:
|
|||||||
pthread ();
|
pthread ();
|
||||||
virtual ~pthread ();
|
virtual ~pthread ();
|
||||||
|
|
||||||
static void init_mainthread ();
|
static void init_mainthread (const bool forked = false);
|
||||||
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user