Bug 749849: Delete the _PT_PTHREAD_KEY_DELETE macro. Fix a comment typo.
authorwtc%google.com
Tue, 23 Oct 2012 01:03:41 +0000
changeset 4415 71e705debdde264a30f875b6645d90a0bcf70c44
parent 4414 94d38afa8c17d404fe96c0c133488578e999e90e
child 4416 de08da63828d8057b3c888370512674ab4f29e25
push idunknown
push userunknown
push dateunknown
bugs749849
Bug 749849: Delete the _PT_PTHREAD_KEY_DELETE macro. Fix a comment typo. Patch by Kai Engert <kaie@kuix.de>. r=wtc. Modified Files: pr/include/md/_pth.h pr/src/pthreads/ptthread.c
pr/include/md/_pth.h
pr/src/pthreads/ptthread.c
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -125,29 +125,26 @@
 #error "pthreads is not supported for this architecture"
 #endif
 
 #if defined(_PR_DCETHREADS)
 #define _PT_PTHREAD_ATTR_INIT            pthread_attr_create
 #define _PT_PTHREAD_ATTR_DESTROY         pthread_attr_delete
 #define _PT_PTHREAD_CREATE(t, a, f, r)   pthread_create(t, a, f, r) 
 #define _PT_PTHREAD_KEY_CREATE           pthread_keycreate
-#define _PT_PTHREAD_KEY_DELETE           pthread_keydelete
-/* Set _PT_PTHREAD_KEY_DELETE to empty if pthread_keydelete isn't available */
 #define _PT_PTHREAD_ATTR_SETSCHEDPOLICY  pthread_attr_setsched
 #define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) \
                                      (*(s) = pthread_attr_getstacksize(*(a)), 0)
 #define _PT_PTHREAD_GETSPECIFIC(k, r) \
 		pthread_getspecific((k), (pthread_addr_t *) &(r))
 #elif defined(_PR_PTHREADS)
 #define _PT_PTHREAD_ATTR_INIT            pthread_attr_init
 #define _PT_PTHREAD_ATTR_DESTROY         pthread_attr_destroy
 #define _PT_PTHREAD_CREATE(t, a, f, r)   pthread_create(t, &a, f, r) 
 #define _PT_PTHREAD_KEY_CREATE           pthread_key_create
-#define _PT_PTHREAD_KEY_DELETE           pthread_key_delete
 #define _PT_PTHREAD_ATTR_SETSCHEDPOLICY  pthread_attr_setschedpolicy
 #define _PT_PTHREAD_ATTR_GETSTACKSIZE(a, s) pthread_attr_getstacksize(a, s)
 #define _PT_PTHREAD_GETSPECIFIC(k, r)    (r) = pthread_getspecific(k)
 #else
 #error "Cannot determine pthread strategy"
 #endif
 
 #if defined(_PR_DCETHREADS)
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -38,17 +38,17 @@ static PRIntn pt_schedpriv = 0;
 extern PRLock *_pr_sleeplock;
 
 static struct _PT_Bookeeping
 {
     PRLock *ml;                 /* a lock to protect ourselves */
     PRCondVar *cv;              /* used to signal global things */
     PRInt32 system, user;       /* a count of the two different types */
     PRUintn this_many;          /* number of threads allowed for exit */
-    pthread_key_t key;          /* private private data key */
+    pthread_key_t key;          /* thread private data key */
     PRThread *first, *last;     /* list of threads we know about */
 #if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
     PRInt32 minPrio, maxPrio;   /* range of scheduling priorities */
 #endif
 } pt_book = {0};
 
 static void _pt_thread_death(void *arg);
 static void _pt_thread_death_internal(void *arg, PRBool callDestructors);
@@ -970,17 +970,17 @@ void _PR_Fini(void)
         /*
          * PR_FALSE, because it is unsafe to call back to the 
          * thread private data destructors at final cleanup.
          */
         _pt_thread_death_internal(thred, PR_FALSE);
         rv = pthread_setspecific(pt_book.key, NULL);
         PR_ASSERT(0 == rv);
     }
-    _PT_PTHREAD_KEY_DELETE(pt_book.key);
+    pthread_key_delete(pt_book.key);
     /* TODO: free other resources used by NSPR */
     /* _pr_initialized = PR_FALSE; */
 }  /* _PR_Fini */
 
 PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
 {
     PRThread *me = PR_GetCurrentThread();
     int rv;