summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hotmail.com>2002-09-30 21:06:05 +0000
committerRobert Collins <rbtcollins@hotmail.com>2002-09-30 21:06:05 +0000
commit404f35cb5cec4702c5f61049997f9f0661925e7a (patch)
tree312fab9ed217271857818856084e24f9bc3f69f8
parent18be975d30156bf2d0d8d19534826eea0fffd943 (diff)
downloadcygnal-404f35cb5cec4702c5f61049997f9f0661925e7a.tar.gz
cygnal-404f35cb5cec4702c5f61049997f9f0661925e7a.tar.bz2
cygnal-404f35cb5cec4702c5f61049997f9f0661925e7a.zip
2002-10-01 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining why. (pthreadNull::_instance): Copy on fork. Absolutely no state exists in pthreadNull.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/thread.cc8
2 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b804b8fce..077d43b8e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-01 Robert Collins <rbtcollins@hotmail.com>
+
+ * thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining
+ why.
+ (pthreadNull::_instance): Copy on fork. Absolutely no state exists
+ in pthreadNull.
+
2002-09-30 Conrad Scott <conrad.scott@dsl.pipex.com>
* cygserver_transport_pipes.cc (transport_layer_pipes::accept):
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 8c1213a76..1ccebb24b 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -190,7 +190,7 @@ MTinterface::Init (int forked)
threadcount = 1; /* 1 current thread when Init occurs.*/
pthread::initMainThread (&mainthread, myself->hProcess);
- pthread_mutex::initMutex ();
+ pthread_mutex::initMutex ();
if (forked)
return;
@@ -935,7 +935,8 @@ pthread_cond::fixup_after_fork ()
/* pthread_key */
/* static members */
-List<pthread_key> pthread_key::keys NO_COPY;
+/* This stores pthread_key information across fork() boundaries */
+List<pthread_key> pthread_key::keys;
void
pthread_key::saveAKey (pthread_key *key)
@@ -1097,6 +1098,7 @@ pthread_mutex::isGoodInitializerOrObject (pthread_mutex_t const *mutex)
return true;
}
+/* This is used for mutex creation protection within a single process only */
pthread_mutex::nativeMutex pthread_mutex::mutexInitializationLock NO_COPY;
/* We can only be called once.
@@ -2640,6 +2642,6 @@ pthreadNull::getsequence_np ()
return 0;
}
-pthreadNull NO_COPY pthreadNull::_instance;
+pthreadNull pthreadNull::_instance;
#endif // MT_SAFE