Commit 9b848d9e authored by Mikael Ronstrom's avatar Mikael Ronstrom

Fixed a number of compiler issues and attempted a fix for

Windows compilation error.
parent eeddb067
...@@ -6833,8 +6833,7 @@ innodb_show_status( ...@@ -6833,8 +6833,7 @@ innodb_show_status(
mutex_enter_noninline(&srv_monitor_file_mutex); mutex_enter_noninline(&srv_monitor_file_mutex);
rewind(srv_monitor_file); rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file, srv_printf_innodb_monitor(srv_monitor_file);
&trx_list_start, &trx_list_end);
flen = ftell(srv_monitor_file); flen = ftell(srv_monitor_file);
os_file_set_eof(srv_monitor_file); os_file_set_eof(srv_monitor_file);
......
...@@ -463,11 +463,7 @@ Outputs to a file the output of the InnoDB Monitor. */ ...@@ -463,11 +463,7 @@ Outputs to a file the output of the InnoDB Monitor. */
void void
srv_printf_innodb_monitor( srv_printf_innodb_monitor(
/*======================*/ /*======================*/
FILE* file, /* in: output stream */ FILE* file); /* in: output stream */
ulint* trx_start, /* out: file position of the start of
the list of active transactions */
ulint* trx_end); /* out: file position of the end of
the list of active transactions */
/********************************************************************** /**********************************************************************
Function to pass InnoDB status variables to MySQL */ Function to pass InnoDB status variables to MySQL */
......
...@@ -117,6 +117,20 @@ rw_lock_validate( ...@@ -117,6 +117,20 @@ rw_lock_validate(
/*=============*/ /*=============*/
rw_lock_t* lock); rw_lock_t* lock);
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/**********************************************************************
Low-level function which tries to lock an rw-lock in s-mode. Performs no
spinning. */
UNIV_INLINE
ibool
rw_lock_s_lock_low(
/*===============*/
/* out: TRUE if success */
rw_lock_t* lock, /* in: pointer to rw-lock */
ulint pass,
/* in: pass value; != 0, if the lock will be
passed to another thread to unlock */
const char* file_name, /* in: file name where lock requested */
ulint line); /* in: line where requested */
/****************************************************************** /******************************************************************
NOTE! The following macros should be used in rw s-locking, not the NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */ corresponding function. */
......
...@@ -474,13 +474,15 @@ rw_lock_x_unlock_func( ...@@ -474,13 +474,15 @@ rw_lock_x_unlock_func(
#endif #endif
) )
{ {
os_thread_id_t local_writer_thread;
ut_ad((lock->lock_word % X_LOCK_DECR) == 0); ut_ad((lock->lock_word % X_LOCK_DECR) == 0);
/* Must reset writer_thread while we still have the lock. /*
If we are not the last unlocker, we correct it later in the function, Must reset writer_thread while we still have the lock.
which is harmless since we still hold the lock. */ If we are not the last unlocker, we correct it later in the function,
/* TODO: are there any risks of a thread id == -1 on any platform? */ which is harmless since we still hold the lock.
os_thread_id_t local_writer_thread; TODO: are there any risks of a thread id == -1 on any platform?
*/
local_writer_thread = lock->writer_thread; local_writer_thread = lock->writer_thread;
lock->writer_thread = -1; lock->writer_thread = -1;
......
...@@ -3432,8 +3432,6 @@ void ...@@ -3432,8 +3432,6 @@ void
os_aio_simulated_wake_handler_threads(void) os_aio_simulated_wake_handler_threads(void)
/*=======================================*/ /*=======================================*/
{ {
ulint i;
if (os_aio_use_native_aio) { if (os_aio_use_native_aio) {
/* We do not use simulated aio: do nothing */ /* We do not use simulated aio: do nothing */
...@@ -4405,7 +4403,7 @@ os_aio_print( ...@@ -4405,7 +4403,7 @@ os_aio_print(
putc('\n', file); putc('\n', file);
fprintf(file, fprintf(file,
"Summary of background IO slot status: %lu issued, " "Summary of background IO slot status: %lu issued, "
"%lu done, %lu claimed, sleep set %d\n", "%lu done, %lu claimed, sleep set %u\n",
num_issued, num_done, num_claimed, num_issued, num_done, num_claimed,
os_aio_recommend_sleep_for_read_threads); os_aio_recommend_sleep_for_read_threads);
......
...@@ -664,8 +664,6 @@ are indexed by the type of the thread. */ ...@@ -664,8 +664,6 @@ are indexed by the type of the thread. */
ulint srv_n_threads_active[SRV_MASTER + 1]; ulint srv_n_threads_active[SRV_MASTER + 1];
ulint srv_n_threads[SRV_MASTER + 1]; ulint srv_n_threads[SRV_MASTER + 1];
static void srv_reset_free_tickets(trx_t* trx);
static void time_spin_delay() static void time_spin_delay()
{ {
ulint start_sec, end_sec; ulint start_sec, end_sec;
...@@ -1697,11 +1695,7 @@ Outputs to a file the output of the InnoDB Monitor. */ ...@@ -1697,11 +1695,7 @@ Outputs to a file the output of the InnoDB Monitor. */
void void
srv_printf_innodb_monitor( srv_printf_innodb_monitor(
/*======================*/ /*======================*/
FILE* file, /* in: output stream */ FILE* file) /* in: output stream */
ulint* trx_start, /* out: file position of the start of
the list of active transactions */
ulint* trx_end) /* out: file position of the end of
the list of active transactions */
{ {
double time_elapsed; double time_elapsed;
time_t current_time; time_t current_time;
...@@ -1994,14 +1988,13 @@ srv_lock_timeout_and_monitor_thread( ...@@ -1994,14 +1988,13 @@ srv_lock_timeout_and_monitor_thread(
last_monitor_time = time(NULL); last_monitor_time = time(NULL);
if (srv_print_innodb_monitor) { if (srv_print_innodb_monitor) {
srv_printf_innodb_monitor(stderr, NULL, NULL); srv_printf_innodb_monitor(stderr);
} }
if (srv_innodb_status) { if (srv_innodb_status) {
mutex_enter(&srv_monitor_file_mutex); mutex_enter(&srv_monitor_file_mutex);
rewind(srv_monitor_file); rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file, NULL, srv_printf_innodb_monitor(srv_monitor_file);
NULL);
os_file_set_eof(srv_monitor_file); os_file_set_eof(srv_monitor_file);
mutex_exit(&srv_monitor_file_mutex); mutex_exit(&srv_monitor_file_mutex);
} }
......
...@@ -1251,7 +1251,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1251,7 +1251,7 @@ innobase_start_or_create_for_mysql(void)
/* Restrict the maximum number of file i/o threads */ /* Restrict the maximum number of file i/o threads */
if ((srv_n_read_io_threads + srv_n_write_io_threads) > SRV_MAX_N_IO_THREADS) { if ((srv_n_read_io_threads + srv_n_write_io_threads) > SRV_MAX_N_IO_THREADS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: requested too many read(%d) or write(%d) IO threads, max is %d\n", "InnoDB: requested too many read(%u) or write(%u) IO threads, max is %d\n",
srv_n_read_io_threads, srv_n_write_io_threads, SRV_MAX_N_IO_THREADS); srv_n_read_io_threads, srv_n_write_io_threads, SRV_MAX_N_IO_THREADS);
return(DB_ERROR); return(DB_ERROR);
} }
...@@ -1272,7 +1272,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1272,7 +1272,7 @@ innobase_start_or_create_for_mysql(void)
if (n_threads > SRV_MAX_N_IO_THREADS) { if (n_threads > SRV_MAX_N_IO_THREADS) {
fprintf(stderr, fprintf(stderr,
"InnoDB: requested too many IO threads(%d), max is %d\n", "InnoDB: requested too many IO threads(%u), max is %d\n",
n_threads, SRV_MAX_N_IO_THREADS); n_threads, SRV_MAX_N_IO_THREADS);
return(DB_ERROR); return(DB_ERROR);
} }
......
...@@ -417,7 +417,7 @@ rw_lock_x_lock_move_ownership( ...@@ -417,7 +417,7 @@ rw_lock_x_lock_move_ownership(
os_thread_id_t local_writer_thread = lock->writer_thread; os_thread_id_t local_writer_thread = lock->writer_thread;
os_thread_id_t new_writer_thread = os_thread_get_curr_id(); os_thread_id_t new_writer_thread = os_thread_get_curr_id();
while (TRUE) { while (TRUE) {
if (local_writer_thread != -1) { if ((int)local_writer_thread != -1) {
if(os_compare_and_swap( if(os_compare_and_swap(
&(lock->writer_thread), &(lock->writer_thread),
local_writer_thread, local_writer_thread,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment