Commit dc95f565 authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi
Browse files

os0thread.c Use pthread_attr_init instead of ..._create

parent 732d702f
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -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
}