OSDN Git Service

* Makefile.in (new-cygwin1.dll): Reorganize library order.
authorcgf <cgf>
Thu, 10 Oct 2002 05:23:23 +0000 (05:23 +0000)
committercgf <cgf>
Thu, 10 Oct 2002 05:23:23 +0000 (05:23 +0000)
* dcrt0.cc (do_exit): Move thread stuff after vfork stuff or threads are
terminated during vfork.
* sigproc.cc (proc_terminate): Grab proc lock prior to signalling subproc
thread exit to avoid an extra "wait-for-thread-to-exit".

winsup/cygwin/ChangeLog
winsup/cygwin/Makefile.in
winsup/cygwin/dcrt0.cc
winsup/cygwin/sigproc.cc

index e006d7e..7ed69ff 100644 (file)
@@ -1,3 +1,12 @@
+2002-10-10  Christopher Faylor  <cgf@redhat.com>
+
+       * Makefile.in (new-cygwin1.dll): Reorganize library order.
+
+       * dcrt0.cc (do_exit): Move thread stuff after vfork stuff or threads
+       are terminated during vfork.
+       * sigproc.cc (proc_terminate): Grab proc lock prior to signalling
+       subproc thread exit to avoid an extra "wait-for-thread-to-exit".
+
 2002-10-09  Christopher Faylor  <cgf@redhat.com>
 
        * cygthread.cc (cygthread::stub): Don't create an event for "cygself"
        * thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining
        why.
        (pthreadNull::_instance): Copy on fork. Absolutely no state exists
-       in pthreadNull. 
+       in pthreadNull.
 
 2002-09-30  Conrad Scott  <conrad.scott@dsl.pipex.com>
 
        (pthread_mutex::nativeMutex::init): Implement.
        (pthread_mutex::nativeMutex::lock): Ditto.
        (pthread_mutex::nativeMutex::unlock): Ditto.
-               (pthread_mutex::init): Use the wrapper lock and unlockcalls.
-       * thread.h (pthread_mutex): Move mutexInitializationLock into a 
+       (pthread_mutex::init): Use the wrapper lock and unlockcalls.
+       * thread.h (pthread_mutex): Move mutexInitializationLock into a
        nativeMutex wrapper class.
 
 2002-09-30  Christopher Faylor  <cgf@redhat.com>
        * pthread.cc (pthread_mutex_init): Use new pthread_mutex::init.
        * thread.cc: Change __pthread_mutex_init to pthread_mutex::init
        throughout.
-               (MTinterface::Init): Initialise pthread_mutex support.
+       (MTinterface::Init): Initialise pthread_mutex support.
        (pthread_mutex::mutexInitializationLock): Instantiate.
        (pthread_mutex::initMutex): New method.
        (__pthread_cond_dowait): Don't dereference untrusted pointers.
        (__pthread_mutex_init): Rename to pthread_mutex::init.
        Lock and release mutexInitializationLock to prevent races on
        mutex initialisation.
-       * thread.h (pthread_mutex::initMutex): New method, initialise 
+       * thread.h (pthread_mutex::initMutex): New method, initialise
        pthread_mutex supporting state on process initialisation.
        (pthread_mutex::init): Initialise a single mutex.
        (pthread_mutex::mutexInitializationLock): A win32 mutex for
        * fhandler_process.cc: Add <sys/param.h> include.
        (format_process_stat): Make number of 'jiffies' per second same as
        HZ define. Use KernelTime and UserTime only to calculate start_time.
-       
+
 2002-08-30  Christopher Faylor  <cgf@redhat.com>
 
        (inspired by a patch from Egor Duda)
index 9a28dac..218d9de 100644 (file)
@@ -257,8 +257,8 @@ maintainer-clean realclean: clean
 new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
        $(CXX) $(CXXFLAGS) -nostdlib -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \
        -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
-       $(MALLOC_OBJ) $(LIBM) $(LIBC) \
-       -lstdc++ -lgcc $(DLL_IMPORTS)
+       $(MALLOC_OBJ) $(LIBM) -lstdc++ $(LIBC) \
+       -lgcc $(DLL_IMPORTS)
 
 # Rule to build libcygwin.a
 $(LIB_NAME): rmsym newsym new-$(DLL_NAME) $(LIBCOS)
index 2959c6f..f55b26d 100644 (file)
@@ -959,6 +959,12 @@ do_exit (int status)
   UINT n = (UINT) status;
   static int NO_COPY exit_state = 0;
 
+  syscall_printf ("do_exit (%d)", n);
+
+  vfork_save *vf = vfork_storage.val ();
+  if (vf != NULL && vf->pid < 0)
+    vf->restore_exit (status);
+
   if (!DisableThreadLibraryCalls (cygwin_hmodule))
     system_printf ("DisableThreadLibraryCalls (%p) failed, %E",
                   cygwin_hmodule);
@@ -969,12 +975,6 @@ do_exit (int status)
       cygthread::terminate ();
     }
 
-  syscall_printf ("do_exit (%d)", n);
-
-  vfork_save *vf = vfork_storage.val ();
-  if (vf != NULL && vf->pid < 0)
-    vf->restore_exit (status);
-
   if (exit_state < ES_SIGNAL)
     {
       exit_state = ES_SIGNAL;
index 8cc459c..db5626b 100644 (file)
@@ -457,10 +457,10 @@ proc_terminate (void)
   if (hwait_subproc)
     {
       proc_loop_wait = 0;      // Tell wait_subproc thread to exit
+      sync_proc_subproc->acquire (WPSP);
       wake_wait_subproc ();    // Wake wait_subproc loop
       hwait_subproc = NULL;
 
-      sync_proc_subproc->acquire (WPSP);
       (void) proc_subproc (PROC_CLEARWAIT, 1);
 
       /* Clean out zombie processes from the pid list. */