* 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".
This commit is contained in:
Christopher Faylor 2002-10-10 05:23:23 +00:00
parent c4ec64d76b
commit 2a3bf3e2ce
4 changed files with 24 additions and 15 deletions

View 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"
@ -93,7 +102,7 @@
* 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>
@ -127,8 +136,8 @@
(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>
@ -166,7 +175,7 @@
* 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.
@ -175,7 +184,7 @@
(__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
@ -1714,7 +1723,7 @@
* 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)

View 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)

View 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;

View 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. */