]> gcc.gnu.org Git - gcc.git/commitdiff
(objc_thread_id): Use pthread_getunique_np to obtain a thread ID value.
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 28 Jun 1996 22:50:43 +0000 (18:50 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 28 Jun 1996 22:50:43 +0000 (18:50 -0400)
(objc_mutex_allocate): Cast mutex->owner to _objc_thread_t.
(objc_mutex_deallocate): Likewise.
(objc_mutex_unlock): Likewise.
(objc_mutex_trylock):  Declare thread_id as _objc_thread_t.
(objc_mutex_lock): Likewise.
(objc_mutex_unlock): Likewise.

From-SVN: r12375

gcc/objc/thr-decosf1.c

index 684f0b848b6dffc46c05f57a80af0ba3de590e36..88fcba71ba1dcd28c938db32c7a659cc9bfeff3d 100644 (file)
@@ -171,7 +171,7 @@ objc_thread_id(void)
 {
   pthread_t self = pthread_self();
 
-  return (_objc_thread_t) self;        /* Return thread handle.    */
+  return (_objc_thread_t) pthread_getuniqe_np (&self);
 }
 
 /********
@@ -219,7 +219,7 @@ objc_mutex_allocate(void)
         free(mutex);                            /* Yes, free local memory.  */
         return NULL;                            /* Abort.                   */
     }
-    mutex->owner = -1;                          /* No owner.                */
+    mutex->owner = (_objc_thread_t) -1;         /* No owner.                */
     mutex->depth = 0;                           /* No locks.                */
     return mutex;                               /* Return mutex handle.     */
 }
@@ -256,7 +256,7 @@ objc_mutex_deallocate(_objc_mutex_t mutex)
 int
 objc_mutex_lock(_objc_mutex_t mutex)
 {
-    int         thread_id;                      /* Cache our thread id.     */
+    _objc_thread_t thread_id;                   /* Cache our thread id.     */
 
     if (!mutex)                                 /* Is argument bad?         */
         return -1;                              /* Yes, abort.              */
@@ -279,7 +279,7 @@ objc_mutex_lock(_objc_mutex_t mutex)
 int
 objc_mutex_trylock(_objc_mutex_t mutex)
 {
-    int         thread_id;                      /* Cache our thread id.     */
+    _objc_thread_t thread_id;                   /* Cache our thread id.     */
 
     if (!mutex)                                 /* Is argument bad?         */
         return -1;                              /* Yes, abort.              */
@@ -304,7 +304,7 @@ objc_mutex_trylock(_objc_mutex_t mutex)
 int
 objc_mutex_unlock(_objc_mutex_t mutex)
 {
-    int         thread_id;                      /* Cache our thread id.     */
+    _objc_thread_t thread_id;                   /* Cache our thread id.     */
     
     if (!mutex)                                 /* Is argument bad?         */
         return -1;                              /* Yes, abort.              */
@@ -314,7 +314,7 @@ objc_mutex_unlock(_objc_mutex_t mutex)
     if (mutex->depth > 1)                       /* Released last lock?      */
         return --mutex->depth;                  /* No, Decrement depth, end.*/
     mutex->depth = 0;                           /* Yes, reset depth to 0.   */
-    mutex->owner = -1;                          /* Set owner to "no thread".*/
+    mutex->owner = (_objc_thread_t) -1;         /* Set owner to "no thread".*/
     
     if (pthread_mutex_unlock(&mutex->lock) != 0)  /* Unlock system mutex.   */
         return -1;                              /* Failed, abort.           */
This page took 0.213625 seconds and 5 git commands to generate.