1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-16 22:03:23 +03:00

Add platform-specific os_thread_ret_t and OS_THREAD_DUMMY_RETURN, and

convert thread start functions to use them.
This commit is contained in:
osku
2006-04-21 12:09:12 +00:00
parent 160cd2b29e
commit ca150507fc
6 changed files with 27 additions and 72 deletions

View File

@@ -344,11 +344,7 @@ srv_release_threads(
/*************************************************************************
The master thread controlling the server. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_master_thread(
/*==============*/
/* out: a dummy parameter */
@@ -430,11 +426,7 @@ srv_release_mysql_thread_if_suspended(
A thread which wakes up threads whose lock wait may have lasted too long.
This also prints the info output by various InnoDB monitors. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_lock_timeout_and_monitor_thread(
/*================================*/
/* out: a dummy parameter */
@@ -444,11 +436,7 @@ srv_lock_timeout_and_monitor_thread(
A thread which prints warnings about semaphore waits which have lasted
too long. These can be used to track bugs which cause hangs. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_error_monitor_thread(
/*=====================*/
/* out: a dummy parameter */

View File

@@ -107,11 +107,7 @@ transaction already was committed, then we clean up a possible insert
undo log. If the transaction was not yet committed, then we roll it back.
Note: this is done in a background thread. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
trx_rollback_or_clean_all_without_sess(
/*===================================*/
/* out: a dummy parameter */

View File

@@ -273,6 +273,18 @@ it is read or written. */
/* Compile-time constant of the given array's size. */
#define UT_ARR_SIZE(a) (sizeof(a) / sizeof((a)[0]))
/* The return type from a thread's start function differs between Unix and
Windows, so define a typedef for it and a macro to use at the end of such
functions. */
#ifdef __WIN__
typedef ulint os_thread_ret_t;
#define OS_THREAD_DUMMY_RETURN return(0)
#else
typedef void* os_thread_ret_t;
#define OS_THREAD_DUMMY_RETURN return(NULL)
#endif
#include <stdio.h>
#include "ut0dbg.h"
#include "ut0ut.h"

View File

@@ -1819,11 +1819,7 @@ srv_export_innodb_status(void)
A thread which wakes up threads whose lock wait may have lasted too long.
This also prints the info output by various InnoDB monitors. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_lock_timeout_and_monitor_thread(
/*================================*/
/* out: a dummy parameter */
@@ -1995,22 +1991,15 @@ exit_func:
thread should always use that to exit and not use return() to exit. */
os_thread_exit(NULL);
#ifndef __WIN__
return(NULL);
#else
return(0);
#endif
OS_THREAD_DUMMY_RETURN;
}
/*************************************************************************
A thread which prints warnings about semaphore waits which have lasted
too long. These can be used to track bugs which cause hangs. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_error_monitor_thread(
/*=====================*/
/* out: a dummy parameter */
@@ -2092,11 +2081,7 @@ loop:
os_thread_exit(NULL);
#ifndef __WIN__
return(NULL);
#else
return(0);
#endif
OS_THREAD_DUMMY_RETURN;
}
/***********************************************************************
@@ -2141,11 +2126,7 @@ srv_wake_master_thread(void)
/*************************************************************************
The master thread controlling the server. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
srv_master_thread(
/*==============*/
/* out: a dummy parameter */
@@ -2590,10 +2571,6 @@ suspend_thread:
os_thread_exit(NULL);
#ifndef __WIN__
return(NULL); /* Not reached */
#else
return(0);
#endif
OS_THREAD_DUMMY_RETURN;
}
#endif /* !UNIV_HOTBACKUP */

View File

@@ -426,11 +426,7 @@ srv_parse_log_group_home_dirs(
I/o-handler thread function. */
static
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
io_handler_thread(
/*==============*/
void* arg)
@@ -459,11 +455,7 @@ io_handler_thread(
os_thread_exit(NULL);
#ifndef __WIN__
return(NULL); /* Not reached */
#else
return(0);
#endif
OS_THREAD_DUMMY_RETURN;
}
#endif /* !UNIV_HOTBACKUP */

View File

@@ -391,11 +391,7 @@ transaction already was committed, then we clean up a possible insert
undo log. If the transaction was not yet committed, then we roll it back.
Note: this is done in a background thread. */
#ifndef __WIN__
void*
#else
ulint
#endif
os_thread_ret_t
trx_rollback_or_clean_all_without_sess(
/*===================================*/
/* out: a dummy parameter */
@@ -576,13 +572,7 @@ leave_function:
os_thread_exit(NULL);
/* The following is dummy code to keep the compiler happy: */
#ifndef __WIN__
return(NULL);
#else
return(0);
#endif
OS_THREAD_DUMMY_RETURN;
}
/***********************************************************************