aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-06-28 18:50:43 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-06-28 18:50:43 -0400
commitd5d5fa1824bb3ea4a27be6436521fdb10262ce07 (patch)
treed544fa5185c2cdcf3608189e50b11013ed61b553 /gcc
parentb05a8d8a6bdcd94a8c151792f2e8fecb4aa83ccf (diff)
downloadgcc-d5d5fa1824bb3ea4a27be6436521fdb10262ce07.zip
gcc-d5d5fa1824bb3ea4a27be6436521fdb10262ce07.tar.gz
gcc-d5d5fa1824bb3ea4a27be6436521fdb10262ce07.tar.bz2
(objc_thread_id): Use pthread_getunique_np to obtain a thread ID value.
(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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/objc/thr-decosf1.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/objc/thr-decosf1.c b/gcc/objc/thr-decosf1.c
index 684f0b8..88fcba7 100644
--- a/gcc/objc/thr-decosf1.c
+++ b/gcc/objc/thr-decosf1.c
@@ -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. */