mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
os0thread.h, os0thread.c:
Fix a critical portability bug introduced in the Windows version innobase/os/os0thread.c: Fix a critical portability bug introduced in the Windows version innobase/include/os0thread.h: Fix a critical portability bug introduced in the Windows version
This commit is contained in:
@ -19,14 +19,14 @@ Created 9/8/1995 Heikki Tuuri
|
||||
#include "srv0srv.h"
|
||||
|
||||
/*******************************************************************
|
||||
Compares two threads or thread ids for equality */
|
||||
Compares two thread ids for equality. */
|
||||
|
||||
ibool
|
||||
os_thread_eq(
|
||||
/*=========*/
|
||||
/* out: TRUE if equal */
|
||||
os_thread_t a, /* in: OS thread or thread id */
|
||||
os_thread_t b) /* in: OS thread or thread id */
|
||||
os_thread_id_t a, /* in: OS thread or thread id */
|
||||
os_thread_id_t b) /* in: OS thread or thread id */
|
||||
{
|
||||
#ifdef __WIN__
|
||||
if (a == b) {
|
||||
@ -44,13 +44,13 @@ os_thread_eq(
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Converts an OS thread or thread id to a ulint. It is NOT guaranteed that
|
||||
the ulint is unique for the thread though! */
|
||||
Converts an OS thread id to a ulint. It is NOT guaranteed that the ulint is
|
||||
unique for the thread though! */
|
||||
|
||||
ulint
|
||||
os_thread_pf(
|
||||
/*=========*/
|
||||
os_thread_t a)
|
||||
os_thread_id_t a)
|
||||
{
|
||||
#ifdef UNIV_HPUX
|
||||
/* In HP-UX a pthread_t is a struct of 3 fields: field1, field2,
|
||||
@ -64,15 +64,15 @@ os_thread_pf(
|
||||
|
||||
/*********************************************************************
|
||||
Returns the thread identifier of current thread. Currently the thread
|
||||
identifier is the thread handle itself. Note that in HP-UX pthread_t is
|
||||
a struct of 3 fields. */
|
||||
identifier in Unix is the thread handle itself. Note that in HP-UX
|
||||
pthread_t is a struct of 3 fields. */
|
||||
|
||||
os_thread_id_t
|
||||
os_thread_get_curr_id(void)
|
||||
/*=======================*/
|
||||
{
|
||||
#ifdef __WIN__
|
||||
return(GetCurrentThread());
|
||||
return(GetCurrentThreadId());
|
||||
#else
|
||||
return(pthread_self());
|
||||
#endif
|
||||
@ -95,10 +95,8 @@ os_thread_create(
|
||||
#endif
|
||||
void* arg, /* in: argument to start
|
||||
function */
|
||||
os_thread_id_t* thread_id) /* out: id of created
|
||||
thread; currently this is
|
||||
identical to the handle to
|
||||
the thread */
|
||||
os_thread_id_t* thread_id) /* out: id of the created
|
||||
thread */
|
||||
{
|
||||
#ifdef __WIN__
|
||||
os_thread_t thread;
|
||||
@ -120,7 +118,7 @@ os_thread_create(
|
||||
ut_a(SetThreadPriority(thread, srv_query_thread_priority));
|
||||
}
|
||||
|
||||
*thread_id = thread;
|
||||
*thread_id = win_thread_id;
|
||||
|
||||
return(thread);
|
||||
#else
|
||||
|
Reference in New Issue
Block a user