summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-13 02:33:25 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-13 02:33:25 +0300
commit1290c0dece1ca4113ee613a33f978c1fc5b244ac (patch)
treec41f06870984860ffa6298845822b85851140ad4 /innobase
parent51156c5af2a8a3a978085a7c54de0ad55f73775c (diff)
parent465e56b04641381fda9934b3557232f85f8af845 (diff)
downloadmariadb-git-1290c0dece1ca4113ee613a33f978c1fc5b244ac.tar.gz
merge with 3.23.52
BitKeeper/etc/config: Auto merged Docs/manual.texi: Auto merged innobase/trx/trx0trx.c: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/os0thread.h24
-rw-r--r--innobase/os/os0thread.c27
2 files changed, 25 insertions, 26 deletions
diff --git a/innobase/include/os0thread.h b/innobase/include/os0thread.h
index 95a3a95fb74..9459750719f 100644
--- a/innobase/include/os0thread.h
+++ b/innobase/include/os0thread.h
@@ -25,33 +25,37 @@ can wait inside InnoDB */
#ifdef __WIN__
typedef void* os_thread_t;
+typedef ulint os_thread_id_t; /* In Windows the thread id
+ is an unsigned long int */
#else
typedef pthread_t os_thread_t;
+typedef os_thread_t os_thread_id_t; /* In Unix we use the thread
+ handle itself as the id of
+ the thread */
#endif
-#define os_thread_id_t os_thread_t
/* Define a function pointer type to use in a typecast */
typedef void* (*os_posix_f_t) (void*);
/*******************************************************************
-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 */
/********************************************************************
-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(
/*=========*/
/* out: unsigned long int */
- os_thread_t a); /* in: thread or thread id */
+ os_thread_id_t a); /* in: thread or thread id */
/********************************************************************
Creates a new thread of execution. The execution starts from
the function given. The start function takes a void* parameter
@@ -69,10 +73,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 */
/*********************************************************************
A thread calling this function ends its execution. */
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c
index cb1205c5a85..13990b6743b 100644
--- a/innobase/os/os0thread.c
+++ b/innobase/os/os0thread.c
@@ -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,11 +95,8 @@ os_thread_create(
#endif
void* arg, /* in: argument to start
function */
- os_thread_id_t* thread_id __attribute__((unused)))
- /* 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;
@@ -121,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