Commit f0d789f1 authored by Mikael Ronstrom's avatar Mikael Ronstrom

Merged fixes to compiler errors and warnings

parents 832f7c02 9b848d9e
......@@ -6833,8 +6833,7 @@ innodb_show_status(
mutex_enter_noninline(&srv_monitor_file_mutex);
rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file,
&trx_list_start, &trx_list_end);
srv_printf_innodb_monitor(srv_monitor_file);
flen = ftell(srv_monitor_file);
os_file_set_eof(srv_monitor_file);
......
......@@ -463,11 +463,7 @@ Outputs to a file the output of the InnoDB Monitor. */
void
srv_printf_innodb_monitor(
/*======================*/
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 */
FILE* file); /* in: output stream */
/**********************************************************************
Function to pass InnoDB status variables to MySQL */
......
......@@ -117,6 +117,20 @@ rw_lock_validate(
/*=============*/
rw_lock_t* lock);
#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
corresponding function. */
......
......@@ -474,13 +474,15 @@ rw_lock_x_unlock_func(
#endif
)
{
os_thread_id_t local_writer_thread;
ut_ad((lock->lock_word % X_LOCK_DECR) == 0);
/* Must reset writer_thread while we still have the lock.
/*
Must reset writer_thread while we still have the lock.
If we are not the last unlocker, we correct it later in the function,
which is harmless since we still hold the lock. */
/* TODO: are there any risks of a thread id == -1 on any platform? */
os_thread_id_t local_writer_thread;
which is harmless since we still hold the lock.
TODO: are there any risks of a thread id == -1 on any platform?
*/
local_writer_thread = lock->writer_thread;
lock->writer_thread = -1;
......
......@@ -3432,8 +3432,6 @@ void
os_aio_simulated_wake_handler_threads(void)
/*=======================================*/
{
ulint i;
if (os_aio_use_native_aio) {
/* We do not use simulated aio: do nothing */
......@@ -4405,7 +4403,7 @@ loop:
putc('\n', file);
fprintf(file,
"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,
os_aio_recommend_sleep_for_read_threads);
......
......@@ -664,8 +664,6 @@ are indexed by the type of the thread. */
ulint srv_n_threads_active[SRV_MASTER + 1];
ulint srv_n_threads[SRV_MASTER + 1];
static void srv_reset_free_tickets(trx_t* trx);
static void time_spin_delay()
{
ulint start_sec, end_sec;
......@@ -1697,11 +1695,7 @@ Outputs to a file the output of the InnoDB Monitor. */
void
srv_printf_innodb_monitor(
/*======================*/
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 */
FILE* file) /* in: output stream */
{
double time_elapsed;
time_t current_time;
......@@ -1994,14 +1988,13 @@ loop:
last_monitor_time = time(NULL);
if (srv_print_innodb_monitor) {
srv_printf_innodb_monitor(stderr, NULL, NULL);
srv_printf_innodb_monitor(stderr);
}
if (srv_innodb_status) {
mutex_enter(&srv_monitor_file_mutex);
rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file, NULL,
NULL);
srv_printf_innodb_monitor(srv_monitor_file);
os_file_set_eof(srv_monitor_file);
mutex_exit(&srv_monitor_file_mutex);
}
......
......@@ -1251,7 +1251,7 @@ innobase_start_or_create_for_mysql(void)
/* 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) {
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);
return(DB_ERROR);
}
......@@ -1272,7 +1272,7 @@ innobase_start_or_create_for_mysql(void)
if (n_threads > SRV_MAX_N_IO_THREADS) {
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);
return(DB_ERROR);
}
......
......@@ -417,7 +417,7 @@ rw_lock_x_lock_move_ownership(
os_thread_id_t local_writer_thread = lock->writer_thread;
os_thread_id_t new_writer_thread = os_thread_get_curr_id();
while (TRUE) {
if (local_writer_thread != -1) {
if ((int)local_writer_thread != -1) {
if(os_compare_and_swap(
&(lock->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