Commit 476feba9 authored by Jan Lindström's avatar Jan Lindström

Fix unnecessary printout of same writer thread more than once. Fixed

also a compiler warning.
parent 35c78a1f
...@@ -17341,7 +17341,7 @@ ib_senderrf( ...@@ -17341,7 +17341,7 @@ ib_senderrf(
va_start(args, code); va_start(args, code);
myf l; myf l=0;
switch(level) { switch(level) {
case IB_LOG_LEVEL_INFO: case IB_LOG_LEVEL_INFO:
......
...@@ -966,7 +966,7 @@ sync_array_print_long_waits_low( ...@@ -966,7 +966,7 @@ sync_array_print_long_waits_low(
if (*noticed) { if (*noticed) {
for (i = 0; i < arr->n_cells; i++) { for (i = 0; i < arr->n_cells; i++) {
void* wait_object; void* wait_object;
os_thread_id_t reserver=0; os_thread_id_t reserver=ULINT_UNDEFINED;
sync_cell_t* cell; sync_cell_t* cell;
ulint loop = 0; ulint loop = 0;
...@@ -984,7 +984,7 @@ sync_array_print_long_waits_low( ...@@ -984,7 +984,7 @@ sync_array_print_long_waits_low(
sync_array_cell_print(stderr, cell, &reserver); sync_array_cell_print(stderr, cell, &reserver);
/* Try to output cell information for writer recursive way */ /* Try to output cell information for writer recursive way */
while (reserver != 0) { while (reserver != ULINT_UNDEFINED) {
sync_cell_t* reserver_wait; sync_cell_t* reserver_wait;
reserver_wait = sync_array_find_thread(arr, reserver); reserver_wait = sync_array_find_thread(arr, reserver);
...@@ -994,16 +994,22 @@ sync_array_print_long_waits_low( ...@@ -994,16 +994,22 @@ sync_array_print_long_waits_low(
reserver_wait->waiting) { reserver_wait->waiting) {
fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n", fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n",
stderr); stderr);
reserver = ULINT_UNDEFINED;
sync_array_cell_print(stderr, reserver_wait, &reserver); sync_array_cell_print(stderr, reserver_wait, &reserver);
loop++;
if (reserver_wait->thread == reserver) {
reserver = ULINT_UNDEFINED;
}
} else { } else {
reserver = 0; reserver = ULINT_UNDEFINED;
} }
/* This is protection against loop */ /* This is protection against loop */
if (loop > 100) { if (loop > 100) {
fputs("InnoDB: Warning: Too many waiting threads.\n", stderr); fputs("InnoDB: Warning: Too many waiting threads.\n", stderr);
break; break;
} }
} }
} }
} }
......
...@@ -1062,7 +1062,7 @@ sync_array_print_long_waits_low( ...@@ -1062,7 +1062,7 @@ sync_array_print_long_waits_low(
for (i = 0; i < arr->n_cells; i++) { for (i = 0; i < arr->n_cells; i++) {
void* wait_object; void* wait_object;
sync_cell_t* cell; sync_cell_t* cell;
os_thread_id_t reserver=0; os_thread_id_t reserver=ULINT_UNDEFINED;
ulint loop=0; ulint loop=0;
cell = sync_array_get_nth_cell(arr, i); cell = sync_array_get_nth_cell(arr, i);
...@@ -1090,7 +1090,6 @@ sync_array_print_long_waits_low( ...@@ -1090,7 +1090,6 @@ sync_array_print_long_waits_low(
fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n", fputs("InnoDB: Warning: Writer thread is waiting this semaphore:\n",
stderr); stderr);
sync_array_cell_print(stderr, reserver_wait, &reserver); sync_array_cell_print(stderr, reserver_wait, &reserver);
loop++;
} else { } else {
reserver = 0; reserver = 0;
} }
......
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