summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fork.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-04-13 15:28:20 +0000
committerChristopher Faylor <me@cgf.cx>2001-04-13 15:28:20 +0000
commit39b6859a28b8b50d73fe6ae080ea42f4ef1bdea3 (patch)
tree6e6cc0afd7868c2a935f16c4e10a3d20ebf532b3 /winsup/cygwin/fork.cc
parente61cead397205b61dafed0d725cf9dcd89aead76 (diff)
downloadcygnal-39b6859a28b8b50d73fe6ae080ea42f4ef1bdea3.tar.gz
cygnal-39b6859a28b8b50d73fe6ae080ea42f4ef1bdea3.tar.bz2
cygnal-39b6859a28b8b50d73fe6ae080ea42f4ef1bdea3.zip
* fork.cc (fork_child): Call the __pthread_atforkchild function.
(fork_parent): Call the __pthread_atforkparent function. * cygwin.din: Export pthread_atfork. * thread.h (callback): New class. (MTinterface): Use it. * thread.cc (__pthread_atforkprepare): New function. (__pthread_atforkparent): New function. (__pthread_atforkchild): New function. (__pthread_atfork): New function. * pthread.cc (pthread_atfork): New function.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r--winsup/cygwin/fork.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 6d6f10b0c..de85c1d96 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -307,6 +307,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
/* Initialize signal/process handling */
sigproc_init ();
+ __pthread_atforkchild();
cygbench ("fork-child");
return 0;
}
@@ -597,6 +598,7 @@ out:
ForceCloseHandle (forker_finished);
forker_finished = NULL;
pi.hThread = NULL;
+ __pthread_atforkparent();
return forked->pid;
@@ -640,6 +642,9 @@ fork ()
return -1;
}
+ /* call the pthread_atfork prepare functions */
+ __pthread_atforkprepare();
+
void *esp;
__asm ("movl %%esp,%0": "=r" (esp));