aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog10
-rw-r--r--winsup/cygwin/cygthread.cc5
-rw-r--r--winsup/cygwin/cygtls.h3
-rw-r--r--winsup/cygwin/exceptions.cc4
-rw-r--r--winsup/cygwin/fork.cc4
-rw-r--r--winsup/cygwin/tlsoffsets.h114
6 files changed, 75 insertions, 65 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f9c9527..a074d52 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,12 @@
+2005-05-18 Christopher Faylor <cgf@timesys.com>
+
+ * cygtls.h (_local_storage::unknown_thread_name): New buffer.
+ * tlsoffsets.h: Regenerate.
+ * cygthread.cc (cygthread::name): Use new thread-local buffer.
+ * exceptions.cc (handle_exceptions): Avoid unnecessary initialization
+ of static variables to zero.
+ * fork.cc (slow_pid_reuse) Ditto.
+
2005-05-18 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap64): Avoid compiler warning.
@@ -234,7 +243,6 @@
* fhandler_socket.cc (get_inet_addr): Add missing __seterrno call.
-
2005-05-01 Christopher Faylor <cgf@timesys.com>
* fhandler_tty.cc (fhandler_tty_slave::read): Actually read input when
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 59b13be..d032b0f 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -210,9 +210,8 @@ cygthread::name (DWORD tid)
if (!res)
{
- static char buf[30] NO_COPY = {0};
- __small_sprintf (buf, "unknown (%p)", tid);
- res = buf;
+ __small_sprintf (_my_tls.locals.unknown_thread_name, "unknown (%p)", tid);
+ res = _my_tls.locals.unknown_thread_name;
}
return res;
diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h
index 18f7153..257c8ac 100644
--- a/winsup/cygwin/cygtls.h
+++ b/winsup/cygwin/cygtls.h
@@ -92,6 +92,9 @@ struct _local_storage
struct servent *servent_buf; // note: malloced
struct hostent *hostent_buf; // note: malloced
char signamebuf[sizeof ("Unknown signal 4294967295 ")];
+
+ /* cygthread.cc */
+ char unknown_thread_name[30];
};
typedef struct struct_waitq
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index fb4e0e9..b886e34 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -388,8 +388,8 @@ extern "C" DWORD __stdcall RtlUnwind (void *, void *, void *, DWORD);
static int
handle_exceptions (EXCEPTION_RECORD *e0, void *frame, CONTEXT *in0, void *)
{
- static bool NO_COPY debugging = false;
- static int NO_COPY recursed = 0;
+ static bool NO_COPY debugging;
+ static int NO_COPY recursed;
if (debugging && ++debugging < 500000)
{
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index ba7a91e..f2e287c 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -252,8 +252,8 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
static void
slow_pid_reuse (HANDLE h)
{
- static NO_COPY HANDLE last_fork_procs[NPIDS_HELD] = {0};
- static NO_COPY unsigned nfork_procs = 0;
+ static NO_COPY HANDLE last_fork_procs[NPIDS_HELD];
+ static NO_COPY unsigned nfork_procs;
if (nfork_procs >= (sizeof (last_fork_procs) / sizeof (last_fork_procs [0])))
nfork_procs = 0;
diff --git a/winsup/cygwin/tlsoffsets.h b/winsup/cygwin/tlsoffsets.h
index a99b38b..402ca07 100644
--- a/winsup/cygwin/tlsoffsets.h
+++ b/winsup/cygwin/tlsoffsets.h
@@ -1,117 +1,117 @@
//;# autogenerated: Do not edit.
-//; $tls::sizeof__cygtls = 3936;
-//; $tls::func = -3936;
+//; $tls::sizeof__cygtls = 3964;
+//; $tls::func = -3964;
//; $tls::pfunc = 0;
-//; $tls::saved_errno = -3932;
+//; $tls::saved_errno = -3960;
//; $tls::psaved_errno = 4;
-//; $tls::sa_flags = -3928;
+//; $tls::sa_flags = -3956;
//; $tls::psa_flags = 8;
-//; $tls::oldmask = -3924;
+//; $tls::oldmask = -3952;
//; $tls::poldmask = 12;
-//; $tls::deltamask = -3920;
+//; $tls::deltamask = -3948;
//; $tls::pdeltamask = 16;
-//; $tls::event = -3916;
+//; $tls::event = -3944;
//; $tls::pevent = 20;
-//; $tls::errno_addr = -3912;
+//; $tls::errno_addr = -3940;
//; $tls::perrno_addr = 24;
-//; $tls::initialized = -3908;
+//; $tls::initialized = -3936;
//; $tls::pinitialized = 28;
-//; $tls::sigmask = -3904;
+//; $tls::sigmask = -3932;
//; $tls::psigmask = 32;
-//; $tls::sigwait_mask = -3900;
+//; $tls::sigwait_mask = -3928;
//; $tls::psigwait_mask = 36;
-//; $tls::sigwait_info = -3896;
+//; $tls::sigwait_info = -3924;
//; $tls::psigwait_info = 40;
-//; $tls::threadkill = -3892;
+//; $tls::threadkill = -3920;
//; $tls::pthreadkill = 44;
-//; $tls::infodata = -3888;
+//; $tls::infodata = -3916;
//; $tls::pinfodata = 48;
-//; $tls::tid = -3740;
+//; $tls::tid = -3768;
//; $tls::ptid = 196;
-//; $tls::local_clib = -3736;
+//; $tls::local_clib = -3764;
//; $tls::plocal_clib = 200;
-//; $tls::__dontuse = -3736;
+//; $tls::__dontuse = -3764;
//; $tls::p__dontuse = 200;
-//; $tls::locals = -2672;
+//; $tls::locals = -2700;
//; $tls::plocals = 1264;
//; $tls::_ctinfo = -1084;
-//; $tls::p_ctinfo = 2852;
+//; $tls::p_ctinfo = 2880;
//; $tls::wq = -1080;
-//; $tls::pwq = 2856;
+//; $tls::pwq = 2884;
//; $tls::prev = -1052;
-//; $tls::pprev = 2884;
+//; $tls::pprev = 2912;
//; $tls::next = -1048;
-//; $tls::pnext = 2888;
+//; $tls::pnext = 2916;
//; $tls::stackptr = -1044;
-//; $tls::pstackptr = 2892;
+//; $tls::pstackptr = 2920;
//; $tls::sig = -1040;
-//; $tls::psig = 2896;
+//; $tls::psig = 2924;
//; $tls::incyg = -1036;
-//; $tls::pincyg = 2900;
+//; $tls::pincyg = 2928;
//; $tls::spinning = -1032;
-//; $tls::pspinning = 2904;
+//; $tls::pspinning = 2932;
//; $tls::stacklock = -1028;
-//; $tls::pstacklock = 2908;
+//; $tls::pstacklock = 2936;
//; $tls::stack = -1024;
-//; $tls::pstack = 2912;
+//; $tls::pstack = 2940;
//; $tls::padding = 0;
-//; $tls::ppadding = 3936;
+//; $tls::ppadding = 3964;
//; __DATA__
-#define tls_func (-3936)
+#define tls_func (-3964)
#define tls_pfunc (0)
-#define tls_saved_errno (-3932)
+#define tls_saved_errno (-3960)
#define tls_psaved_errno (4)
-#define tls_sa_flags (-3928)
+#define tls_sa_flags (-3956)
#define tls_psa_flags (8)
-#define tls_oldmask (-3924)
+#define tls_oldmask (-3952)
#define tls_poldmask (12)
-#define tls_deltamask (-3920)
+#define tls_deltamask (-3948)
#define tls_pdeltamask (16)
-#define tls_event (-3916)
+#define tls_event (-3944)
#define tls_pevent (20)
-#define tls_errno_addr (-3912)
+#define tls_errno_addr (-3940)
#define tls_perrno_addr (24)
-#define tls_initialized (-3908)
+#define tls_initialized (-3936)
#define tls_pinitialized (28)
-#define tls_sigmask (-3904)
+#define tls_sigmask (-3932)
#define tls_psigmask (32)
-#define tls_sigwait_mask (-3900)
+#define tls_sigwait_mask (-3928)
#define tls_psigwait_mask (36)
-#define tls_sigwait_info (-3896)
+#define tls_sigwait_info (-3924)
#define tls_psigwait_info (40)
-#define tls_threadkill (-3892)
+#define tls_threadkill (-3920)
#define tls_pthreadkill (44)
-#define tls_infodata (-3888)
+#define tls_infodata (-3916)
#define tls_pinfodata (48)
-#define tls_tid (-3740)
+#define tls_tid (-3768)
#define tls_ptid (196)
-#define tls_local_clib (-3736)
+#define tls_local_clib (-3764)
#define tls_plocal_clib (200)
-#define tls___dontuse (-3736)
+#define tls___dontuse (-3764)
#define tls_p__dontuse (200)
-#define tls_locals (-2672)
+#define tls_locals (-2700)
#define tls_plocals (1264)
#define tls__ctinfo (-1084)
-#define tls_p_ctinfo (2852)
+#define tls_p_ctinfo (2880)
#define tls_wq (-1080)
-#define tls_pwq (2856)
+#define tls_pwq (2884)
#define tls_prev (-1052)
-#define tls_pprev (2884)
+#define tls_pprev (2912)
#define tls_next (-1048)
-#define tls_pnext (2888)
+#define tls_pnext (2916)
#define tls_stackptr (-1044)
-#define tls_pstackptr (2892)
+#define tls_pstackptr (2920)
#define tls_sig (-1040)
-#define tls_psig (2896)
+#define tls_psig (2924)
#define tls_incyg (-1036)
-#define tls_pincyg (2900)
+#define tls_pincyg (2928)
#define tls_spinning (-1032)
-#define tls_pspinning (2904)
+#define tls_pspinning (2932)
#define tls_stacklock (-1028)
-#define tls_pstacklock (2908)
+#define tls_pstacklock (2936)
#define tls_stack (-1024)
-#define tls_pstack (2912)
+#define tls_pstack (2940)
#define tls_padding (0)
-#define tls_ppadding (3936)
+#define tls_ppadding (3964)