* cygtls.h: Add alignment kludge to fix disparity between compilers.

* tlsoffsets.h: Regenerate.
* fork.cc (slow_pid_reuse): Use define to control number of pids held to
prevent pid reuse.
This commit is contained in:
Christopher Faylor 2004-09-14 23:44:50 +00:00
parent 98650d2fa2
commit a9f36d288c
4 changed files with 75 additions and 55 deletions

View File

@ -1,3 +1,11 @@
2004-09-14 Christopher Faylor <cgf@timesys.com>
* cygtls.h: Add alignment kludge to fix disparity between compilers.
* tlsoffsets.h: Regenerate.
* fork.cc (slow_pid_reuse): Use define to control number of pids held
to prevent pid reuse.
2004-09-14 Sam Steingold <sds@gnu.org>
* autoload.cc (EnumProcessModules): Add.

View File

@ -98,6 +98,8 @@ typedef struct struct_waitq
/* Changes to the below structure may require acompanying changes to the very
simple parser in the perl script 'gentls_offsets' (<<-- start parsing here).
The union in this structure is used to force alignment between the version
of the compiler used to generate tlsoffsets.h and the cygwin cross compiler.
*/
typedef __uint32_t __stack_t;
@ -117,7 +119,11 @@ struct _cygtls
unsigned threadkill;
siginfo_t infodata;
struct pthread *tid;
struct _reent local_clib;
union
{
struct _reent local_clib;
char __dontuse[8 * ((sizeof(struct _reent) + 4) / 8)];
};
struct _local_storage locals;
waitq wq;
struct _cygtls *prev, *next;

View File

@ -31,6 +31,8 @@ details. */
#include "cygmalloc.h"
#include "cygthread.h"
#define NPIDS_HELD 8
/* Timeout to wait for child to start, parent to init child, etc. */
/* FIXME: Once things stabilize, bump up to a few minutes. */
#define FORK_WAIT_TIMEOUT (300 * 1000) /* 300 seconds */
@ -321,7 +323,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
static void
slow_pid_reuse (HANDLE h)
{
static NO_COPY HANDLE last_fork_procs[8] = {0};
static NO_COPY HANDLE last_fork_procs[NPIDS_HELD] = {0};
static NO_COPY unsigned nfork_procs = 0;
if (nfork_procs >= (sizeof (last_fork_procs) / sizeof (last_fork_procs [0])))

View File

@ -1,109 +1,113 @@
//;# autogenerated: Do not edit.
//; $tls::sizeof__cygtls = 3776;
//; $tls::func = -3776;
//; $tls::sizeof__cygtls = 3912;
//; $tls::func = -3912;
//; $tls::pfunc = 0;
//; $tls::saved_errno = -3772;
//; $tls::saved_errno = -3908;
//; $tls::psaved_errno = 4;
//; $tls::sa_flags = -3768;
//; $tls::sa_flags = -3904;
//; $tls::psa_flags = 8;
//; $tls::oldmask = -3764;
//; $tls::oldmask = -3900;
//; $tls::poldmask = 12;
//; $tls::deltamask = -3760;
//; $tls::deltamask = -3896;
//; $tls::pdeltamask = 16;
//; $tls::event = -3756;
//; $tls::event = -3892;
//; $tls::pevent = 20;
//; $tls::errno_addr = -3752;
//; $tls::errno_addr = -3888;
//; $tls::perrno_addr = 24;
//; $tls::initialized = -3748;
//; $tls::initialized = -3884;
//; $tls::pinitialized = 28;
//; $tls::sigmask = -3744;
//; $tls::sigmask = -3880;
//; $tls::psigmask = 32;
//; $tls::sigwait_mask = -3740;
//; $tls::sigwait_mask = -3876;
//; $tls::psigwait_mask = 36;
//; $tls::sigwait_info = -3736;
//; $tls::sigwait_info = -3872;
//; $tls::psigwait_info = 40;
//; $tls::threadkill = -3732;
//; $tls::threadkill = -3868;
//; $tls::pthreadkill = 44;
//; $tls::infodata = -3728;
//; $tls::infodata = -3864;
//; $tls::pinfodata = 48;
//; $tls::tid = -3580;
//; $tls::tid = -3716;
//; $tls::ptid = 196;
//; $tls::local_clib = -3576;
//; $tls::local_clib = -3712;
//; $tls::plocal_clib = 200;
//; $tls::__dontuse = -3712;
//; $tls::p__dontuse = 200;
//; $tls::locals = -2648;
//; $tls::plocals = 1128;
//; $tls::plocals = 1264;
//; $tls::wq = -1080;
//; $tls::pwq = 2696;
//; $tls::pwq = 2832;
//; $tls::prev = -1052;
//; $tls::pprev = 2724;
//; $tls::pprev = 2860;
//; $tls::next = -1048;
//; $tls::pnext = 2728;
//; $tls::pnext = 2864;
//; $tls::stackptr = -1044;
//; $tls::pstackptr = 2732;
//; $tls::pstackptr = 2868;
//; $tls::sig = -1040;
//; $tls::psig = 2736;
//; $tls::psig = 2872;
//; $tls::incyg = -1036;
//; $tls::pincyg = 2740;
//; $tls::pincyg = 2876;
//; $tls::spinning = -1032;
//; $tls::pspinning = 2744;
//; $tls::pspinning = 2880;
//; $tls::stacklock = -1028;
//; $tls::pstacklock = 2748;
//; $tls::pstacklock = 2884;
//; $tls::stack = -1024;
//; $tls::pstack = 2752;
//; $tls::pstack = 2888;
//; $tls::padding = 0;
//; $tls::ppadding = 3776;
//; $tls::ppadding = 3912;
//; __DATA__
#define tls_func (-3776)
#define tls_func (-3912)
#define tls_pfunc (0)
#define tls_saved_errno (-3772)
#define tls_saved_errno (-3908)
#define tls_psaved_errno (4)
#define tls_sa_flags (-3768)
#define tls_sa_flags (-3904)
#define tls_psa_flags (8)
#define tls_oldmask (-3764)
#define tls_oldmask (-3900)
#define tls_poldmask (12)
#define tls_deltamask (-3760)
#define tls_deltamask (-3896)
#define tls_pdeltamask (16)
#define tls_event (-3756)
#define tls_event (-3892)
#define tls_pevent (20)
#define tls_errno_addr (-3752)
#define tls_errno_addr (-3888)
#define tls_perrno_addr (24)
#define tls_initialized (-3748)
#define tls_initialized (-3884)
#define tls_pinitialized (28)
#define tls_sigmask (-3744)
#define tls_sigmask (-3880)
#define tls_psigmask (32)
#define tls_sigwait_mask (-3740)
#define tls_sigwait_mask (-3876)
#define tls_psigwait_mask (36)
#define tls_sigwait_info (-3736)
#define tls_sigwait_info (-3872)
#define tls_psigwait_info (40)
#define tls_threadkill (-3732)
#define tls_threadkill (-3868)
#define tls_pthreadkill (44)
#define tls_infodata (-3728)
#define tls_infodata (-3864)
#define tls_pinfodata (48)
#define tls_tid (-3580)
#define tls_tid (-3716)
#define tls_ptid (196)
#define tls_local_clib (-3576)
#define tls_local_clib (-3712)
#define tls_plocal_clib (200)
#define tls___dontuse (-3712)
#define tls_p__dontuse (200)
#define tls_locals (-2648)
#define tls_plocals (1128)
#define tls_plocals (1264)
#define tls_wq (-1080)
#define tls_pwq (2696)
#define tls_pwq (2832)
#define tls_prev (-1052)
#define tls_pprev (2724)
#define tls_pprev (2860)
#define tls_next (-1048)
#define tls_pnext (2728)
#define tls_pnext (2864)
#define tls_stackptr (-1044)
#define tls_pstackptr (2732)
#define tls_pstackptr (2868)
#define tls_sig (-1040)
#define tls_psig (2736)
#define tls_psig (2872)
#define tls_incyg (-1036)
#define tls_pincyg (2740)
#define tls_pincyg (2876)
#define tls_spinning (-1032)
#define tls_pspinning (2744)
#define tls_pspinning (2880)
#define tls_stacklock (-1028)
#define tls_pstacklock (2748)
#define tls_pstacklock (2884)
#define tls_stack (-1024)
#define tls_pstack (2752)
#define tls_pstack (2888)
#define tls_padding (0)
#define tls_ppadding (3776)
#define tls_ppadding (3912)