summaryrefslogtreecommitdiff
path: root/innobase/os/os0thread.c
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-08-03 21:53:42 +0300
committerunknown <heikki@hundin.mysql.fi>2002-08-03 21:53:42 +0300
commit5647f6e004243354f2503d74a71ca036d8acb251 (patch)
tree29b2a0a5894ddf7d04ef45c66da2656f5045c3fd /innobase/os/os0thread.c
parent0555398fe48911c40b08ccbe50a2416e072c2710 (diff)
downloadmariadb-git-5647f6e004243354f2503d74a71ca036d8acb251.tar.gz
os0thread.c:
Remove the complex typecast used to convert a HP-UX pthread struct to os_thread_id_t; the typecast seemed to work wrong in gcc-3.1 on HP-UX-10.20 innobase/os/os0thread.c: Remove the complex typecast used to convert a HP-UX pthread struct to os_thread_id_t; the typecast seemed to work wrong in gcc-3.1 on HP-UX-10.20
Diffstat (limited to 'innobase/os/os0thread.c')
-rw-r--r--innobase/os/os0thread.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c
index 74f5fbd9494..44817302340 100644
--- a/innobase/os/os0thread.c
+++ b/innobase/os/os0thread.c
@@ -32,24 +32,20 @@ os_thread_get_curr_id(void)
pthr = pthread_self();
-#ifdef UNIV_HPUX
+#ifdef HPUX
/* TODO: in the future we have to change os_thread_id
- to pthread_t; the following cast may work in a wrong way on some
- systems if pthread_t is a struct; this is just a quick fix
- for HP-UX to eliminate a compiler warning */
+ to pthread_t! */
+ /* In HP-UX a pthread_t seems to be a struct of three fields:
+ field1, field2, field3, and the first probably determines (?)
+ the thread identity. */
- /* The below typecast trick will certainly not work if this assertion
- fails */
-
- ut_a(sizeof(pthread_t) >= sizeof(os_thread_id_t));
-
- return(*(os_thread_id_t*)((void*) (&pthr)));
+ return((os_thread_id_t)(pthr.field1));
#else
/* TODO: define os_thread_id_t in Unix as the same as pthread_t
- and compare them with appropriate Posix pthread functions!
- The following typecast will not work if pthread_t is not
- an integer or a pointer to a unique object for the thread! */
+ and compare them with appropriate Posix pthread functions!
+ The following typecast will not work if pthread_t is not
+ an integer or a pointer to a unique object for the thread! */
return((os_thread_id_t)pthr);
#endif