public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: gcc-patches@gcc.gnu.org
Subject: [basic-improvements] Remove __gthread_key_dtor
Date: Tue, 29 Oct 2002 14:33:00 -0000	[thread overview]
Message-ID: <20021029223346.GB31573@codesourcery.com> (raw)

The __gthread_key_dtor routine does nothing useful in any gthr-*.h
implementation.  This patch removes it, which in turn allows some
minor simplifications in unwind-sjlj.c.

Tested by building an i386-linux -> i386-aout cross compiler,
which includes a compilation of unwind-sjlj.c.

zw

	* gthr.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h,
	gthr-solaris.h, gthr-win32.h: Remove __gthread_key_dtor.
	* unwind-sjlj.c (fc_key_dtor): Delete.
	(fc_key_init): Adjust __gthread_key_create call to match.

===================================================================
Index: gthr-dce.h
--- gthr-dce.h	1 Oct 2002 17:31:48 -0000	1.17.8.1
+++ gthr-dce.h	29 Oct 2002 22:20:12 -0000
@@ -425,13 +425,6 @@ __gthread_key_create (__gthread_key_t *k
 }
 
 static inline int
-__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr))
-{
-  /* Nothing needed.  */
-  return 0;
-}
-
-static inline int
 __gthread_key_delete (UNUSED (__gthread_key_t key))
 {
   /* Operation is not supported.  */
===================================================================
Index: gthr-posix.h
--- gthr-posix.h	1 Oct 2002 17:31:48 -0000	1.22.8.1
+++ gthr-posix.h	29 Oct 2002 22:20:12 -0000
@@ -450,16 +450,6 @@ __gthread_key_create (__gthread_key_t *k
 }
 
 static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
-  /* Just reset the key value to zero.  */
-  if (ptr)
-    return pthread_setspecific (key, 0);
-  else
-    return 0;
-}
-
-static inline int
 __gthread_key_delete (__gthread_key_t key)
 {
   return pthread_key_delete (key);
===================================================================
Index: gthr-rtems.h
--- gthr-rtems.h	4 Jun 2002 11:30:45 -0000	1.7
+++ gthr-rtems.h	29 Oct 2002 22:20:12 -0000
@@ -53,7 +53,6 @@ typedef void *__gthread_mutex_t;
 /* generic per task variables */
 extern int rtems_gxx_once (__gthread_once_t *once, void (*func) (void));
 extern int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *));
-extern int rtems_gxx_key_dtor (__gthread_key_t key, void *ptr);
 extern int rtems_gxx_key_delete (__gthread_key_t key);
 extern void *rtems_gxx_getspecific (__gthread_key_t key);
 extern int rtems_gxx_setspecific (__gthread_key_t key, const void *ptr);
@@ -83,12 +82,6 @@ static inline int
 __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
 {
   return rtems_gxx_key_create( key, dtor );
-}
-
-static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
-   return rtems_gxx_key_dtor(key, ptr);
 }
 
 static inline int
===================================================================
Index: gthr-solaris.h
--- gthr-solaris.h	4 Jun 2002 11:30:46 -0000	1.13
+++ gthr-solaris.h	29 Oct 2002 22:20:12 -0000
@@ -418,13 +418,6 @@ __gthread_key_create (__gthread_key_t *k
 }
 
 static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
-  /* Nothing needed.  */
-  return 0;
-}
-
-static inline int
 __gthread_key_delete (__gthread_key_t key)
 {
   /* Not possible.  */
===================================================================
Index: gthr-win32.h
--- gthr-win32.h	1 Oct 2002 17:31:48 -0000	1.17.8.1
+++ gthr-win32.h	29 Oct 2002 22:20:12 -0000
@@ -396,13 +396,6 @@ __gthread_key_create (__gthread_key_t *k
   return __gthr_win32_key_create (key, dtor);
 }
 
-static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
-  /* Nothing needed.  */
-  return 0;
-}
-  
  static inline int
 __gthread_key_delete (__gthread_key_t key)
 {
@@ -509,15 +502,6 @@ __gthread_key_create (__gthread_key_t *k
   else
     status = (int) GetLastError ();
   return status;
-}
-
-/* Currently, this routine is called only for Mingw runtime, and if
-   -mthreads option is chosen to link in the thread support DLL.  */
-static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
-{
-  /* Nothing needed.  */
-  return 0;
 }
 
 static inline int
===================================================================
Index: gthr.h
--- gthr.h	4 Jun 2002 11:30:44 -0000	1.12
+++ gthr.h	29 Oct 2002 22:20:12 -0000
@@ -62,8 +62,6 @@ Software Foundation, 59 Temple Place - S
      int __gthread_key_create (__gthread_key_t *keyp, void (*dtor) (void *))
      int __gthread_key_delete (__gthread_key_t key)
 
-     int __gthread_key_dtor (__gthread_key_t key, void *ptr)
-
      void *__gthread_getspecific (__gthread_key_t key)
      int __gthread_setspecific (__gthread_key_t key, const void *ptr)
 
===================================================================
Index: unwind-sjlj.c
--- unwind-sjlj.c	17 Sep 2002 22:58:48 -0000	1.8.8.1
+++ unwind-sjlj.c	29 Oct 2002 22:20:12 -0000
@@ -92,15 +92,9 @@ static __gthread_key_t fc_key;
 static int use_fc_key = -1;
 
 static void
-fc_key_dtor (void *ptr)
-{
-  __gthread_key_dtor (fc_key, ptr);
-}
-
-static void
 fc_key_init (void)
 {
-  use_fc_key = __gthread_key_create (&fc_key, fc_key_dtor) == 0;
+  use_fc_key = __gthread_key_create (&fc_key, 0) == 0;
 }
 
 static void

             reply	other threads:[~2002-10-29 22:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-29 14:33 Zack Weinberg [this message]
2002-10-29 23:50 ` Mark Mitchell
2002-10-31 11:18 ` Richard Henderson
2002-10-31 11:42   ` Zack Weinberg
2002-10-31 13:02     ` Richard Henderson
2002-10-31 13:20       ` Zack Weinberg
2002-10-31 13:57         ` Eric Christopher
2002-10-31 16:12           ` Zack Weinberg
2002-11-04 12:11             ` Eric Christopher
2002-11-04 17:08               ` Zack Weinberg
2002-11-04 18:19                 ` Eric Christopher
2002-10-31 12:04   ` Jason R Thorpe
2002-10-31 13:59     ` Eric Christopher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021029223346.GB31573@codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).