Commit fee013ef by Rainer Orth Committed by Rainer Orth

gthr-posix.h (__gthread_objc_thread_detach): Simply cast pthread_t to objc_thread_t.

	* gthr-posix.h (__gthread_objc_thread_detach): Simply cast
	pthread_t to objc_thread_t.
	(__gthread_objc_thread_id): Likewise.

From-SVN: r42974
parent 5076b0ea
2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* gthr-posix.h (__gthread_objc_thread_detach): Simply cast
pthread_t to objc_thread_t.
(__gthread_objc_thread_id): Likewise.
2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* alpha/osf5.h (CPP_XFLOAT_SPEC): Override default definition. * alpha/osf5.h (CPP_XFLOAT_SPEC): Override default definition.
(ASM_OLDAS_SPEC): Likewise. (ASM_OLDAS_SPEC): Likewise.
......
/* Threads compatibility routines for libgcc2 and libobjc. */ /* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */ /* Compile this one with gcc. */
/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. /* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -158,7 +158,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg) ...@@ -158,7 +158,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
return NULL; return NULL;
if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) ) if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
thread_id = *(objc_thread_t *)&new_thread_handle; thread_id = (objc_thread_t) new_thread_handle;
else else
thread_id = NULL; thread_id = NULL;
...@@ -246,13 +246,9 @@ static inline objc_thread_t ...@@ -246,13 +246,9 @@ static inline objc_thread_t
__gthread_objc_thread_id(void) __gthread_objc_thread_id(void)
{ {
if (__gthread_active_p ()) if (__gthread_active_p ())
{ return (objc_thread_t) pthread_self();
pthread_t self = pthread_self();
return *(objc_thread_t *)&self;
}
else else
return (objc_thread_t)1; return (objc_thread_t) 1;
} }
/* Sets the thread's local storage pointer. */ /* Sets the thread's local storage pointer. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment