Commit 5dd24b15 authored by unknown's avatar unknown

os0thread.c Use pthread_attr_init instead of ..._create


innobase/os/os0thread.c:
  Use pthread_attr_init instead of ..._create
parent 476c0f46
...@@ -26,7 +26,16 @@ os_thread_get_curr_id(void) ...@@ -26,7 +26,16 @@ os_thread_get_curr_id(void)
#ifdef __WIN__ #ifdef __WIN__
return(GetCurrentThreadId()); return(GetCurrentThreadId());
#else #else
return((os_thread_id_t) pthread_self()); pthread_t pthr;
pthr = pthread_self();
/* 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 */
return(*(os_thread_id_t*)((void*) (&pthr)));
#endif #endif
} }
...@@ -65,9 +74,14 @@ os_thread_create( ...@@ -65,9 +74,14 @@ os_thread_create(
#else #else
int ret; int ret;
os_thread_t pthread; os_thread_t pthread;
pthread_attr_t attr;
pthread_attr_init(&attr);
ret = pthread_create(&pthread, NULL, start_f, arg); ret = pthread_create(&pthread, NULL, start_f, arg);
pthread_attr_destroy(&attr);
return(pthread); return(pthread);
#endif #endif
} }
......
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