about summary refs log tree commit diff
path: root/linuxthreads/specific.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-02-07 19:30:19 +0000
committerRoland McGrath <roland@gnu.org>2005-02-07 19:30:19 +0000
commit58954d492defb8f9e4e47e181bdc726d41707662 (patch)
tree294a305e5ba838f703e025057a47b0e1ffc59305 /linuxthreads/specific.c
parent9f2b2e4c504bf63920d38ec872701eac394ee2ac (diff)
downloadglibc-58954d492defb8f9e4e47e181bdc726d41707662.tar.gz
glibc-58954d492defb8f9e4e47e181bdc726d41707662.tar.xz
glibc-58954d492defb8f9e4e47e181bdc726d41707662.zip
* nscd/nscd.init (reload): Print Reloading nscd: before and a newline
	after the status string printed by killproc.
Diffstat (limited to 'linuxthreads/specific.c')
-rw-r--r--linuxthreads/specific.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/linuxthreads/specific.c b/linuxthreads/specific.c
index f54fabaeb9..92eec3d99a 100644
--- a/linuxthreads/specific.c
+++ b/linuxthreads/specific.c
@@ -104,15 +104,16 @@ int pthread_key_delete(pthread_key_t key)
      that if the key is reallocated later by pthread_key_create, its
      associated values will be NULL in all threads.
 
-     Do nothing if no threads have been created yet.  */
+     If no threads have been created yet, clear it just in the
+     current thread.  */
 
+  struct pthread_key_delete_helper_args args;
+  args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
+  args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
   if (__pthread_manager_request != -1)
     {
-      struct pthread_key_delete_helper_args args;
       struct pthread_request request;
 
-      args.idx1st = key / PTHREAD_KEY_2NDLEVEL_SIZE;
-      args.idx2nd = key % PTHREAD_KEY_2NDLEVEL_SIZE;
       args.self = 0;
 
       request.req_thread = self;
@@ -124,6 +125,11 @@ int pthread_key_delete(pthread_key_t key)
 					  (char *) &request, sizeof(request)));
       suspend(self);
     }
+  else
+    {
+      if (self->p_specific[args.idx1st] != NULL)
+	self->p_specific[args.idx1st][args.idx2nd] = NULL;
+    }
 
   pthread_mutex_unlock(&pthread_keys_mutex);
   return 0;