summaryrefslogtreecommitdiff
path: root/innobase/os/os0thread.c
diff options
context:
space:
mode:
authorheikki@donna.mysql.fi <>2001-03-14 22:11:16 +0200
committerheikki@donna.mysql.fi <>2001-03-14 22:11:16 +0200
commitdc95f5652e7024dc83d4033acf985f99c981a7ff (patch)
treee8cfc976a6c10c34fe04100bea4602c2240a520b /innobase/os/os0thread.c
parent732d702fd822b511c52c7afc350d26dceb2e720d (diff)
downloadmariadb-git-dc95f5652e7024dc83d4033acf985f99c981a7ff.tar.gz
os0thread.c Use pthread_attr_init instead of ..._create
Diffstat (limited to 'innobase/os/os0thread.c')
-rw-r--r--innobase/os/os0thread.c16
1 files changed, 15 insertions, 1 deletions
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
}