Commit 5647f6e0 authored by unknown's avatar unknown

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
parent 0555398f
...@@ -32,19 +32,15 @@ os_thread_get_curr_id(void) ...@@ -32,19 +32,15 @@ os_thread_get_curr_id(void)
pthr = pthread_self(); pthr = pthread_self();
#ifdef UNIV_HPUX #ifdef HPUX
/* TODO: in the future we have to change os_thread_id /* 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 to pthread_t! */
systems if pthread_t is a struct; this is just a quick fix
for HP-UX to eliminate a compiler warning */
/* 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 return((os_thread_id_t)(pthr.field1));
fails */
ut_a(sizeof(pthread_t) >= sizeof(os_thread_id_t));
return(*(os_thread_id_t*)((void*) (&pthr)));
#else #else
/* TODO: define os_thread_id_t in Unix as the same as pthread_t /* TODO: define os_thread_id_t in Unix as the same as pthread_t
and compare them with appropriate Posix pthread functions! and compare them with appropriate Posix pthread functions!
......
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