From dc95f5652e7024dc83d4033acf985f99c981a7ff Mon Sep 17 00:00:00 2001 From: "heikki@donna.mysql.fi" <> Date: Wed, 14 Mar 2001 22:11:16 +0200 Subject: [PATCH] os0thread.c Use pthread_attr_init instead of ..._create --- innobase/os/os0thread.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c index 8fea31ecf8e..24c3b2708ea 100644 --- a/innobase/os/os0thread.c +++ b/innobase/os/os0thread.c @@ -26,7 +26,16 @@ os_thread_get_curr_id(void) #ifdef __WIN__ return(GetCurrentThreadId()); #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 } @@ -65,9 +74,14 @@ os_thread_create( #else int ret; os_thread_t pthread; + pthread_attr_t attr; + + pthread_attr_init(&attr); ret = pthread_create(&pthread, NULL, start_f, arg); + pthread_attr_destroy(&attr); + return(pthread); #endif }