501
501
sync_array_cell_print (
502
502
/* ==================*/
503
503
FILE* file, /* !< in: file where to print */
504
- sync_cell_t * cell, /* !< in: sync cell */
505
- os_thread_id_t * reserver) /* !< out: write reserver or
506
- 0 */
504
+ sync_cell_t * cell) /* !< in: sync cell */
507
505
{
508
506
rw_lock_t * rwlock;
509
507
ulint type;
@@ -601,7 +599,6 @@ sync_array_cell_print(
601
599
writer == RW_LOCK_X ? " exclusive\n "
602
600
: writer == RW_LOCK_SX ? " SX\n "
603
601
: " wait exclusive\n " );
604
- *reserver = rwlock->writer_thread ;
605
602
}
606
603
607
604
fprintf (file,
@@ -715,7 +712,7 @@ sync_array_report_error(
715
712
sync_cell_t * cell)
716
713
{
717
714
fprintf (stderr, " rw-lock %p " , (void *) lock);
718
- sync_array_cell_print (stderr, cell, 0 );
715
+ sync_array_cell_print (stderr, cell);
719
716
rw_lock_debug_print (stderr, debug);
720
717
}
721
718
@@ -788,7 +785,7 @@ sync_array_detect_deadlock(
788
785
<< " file " << name << " line "
789
786
<< policy.get_enter_line ();
790
787
791
- sync_array_cell_print (stderr, cell, 0 );
788
+ sync_array_cell_print (stderr, cell);
792
789
793
790
return (true );
794
791
}
@@ -1152,7 +1149,7 @@ sync_array_print_long_waits_low(
1152
1149
1153
1150
if (diff > SYNC_ARRAY_TIMEOUT) {
1154
1151
ib::warn () << " A long semaphore wait:" ;
1155
- sync_array_cell_print (stderr, cell, 0 );
1152
+ sync_array_cell_print (stderr, cell);
1156
1153
*noticed = TRUE ;
1157
1154
}
1158
1155
@@ -1167,14 +1164,12 @@ sync_array_print_long_waits_low(
1167
1164
}
1168
1165
}
1169
1166
1170
- /* We found a long semaphore wait, wait all threads that are
1167
+ /* We found a long semaphore wait, print all threads that are
1171
1168
waiting for a semaphore. */
1172
1169
if (*noticed) {
1173
1170
for (i = 0 ; i < arr->n_cells ; i++) {
1174
1171
void * wait_object;
1175
- os_thread_id_t reserver=(os_thread_id_t )ULINT_UNDEFINED;
1176
1172
sync_cell_t * cell;
1177
- ulint loop = 0 ;
1178
1173
1179
1174
cell = sync_array_get_nth_cell (arr, i);
1180
1175
@@ -1185,41 +1180,8 @@ sync_array_print_long_waits_low(
1185
1180
continue ;
1186
1181
}
1187
1182
1188
- fputs (" InnoDB: Warning: semaphore wait:\n " ,
1189
- stderr);
1190
- sync_array_cell_print (stderr, cell, 0 );
1191
-
1192
- /* Try to output cell information for writer recursive way */
1193
- while (reserver != (os_thread_id_t )ULINT_UNDEFINED) {
1194
- sync_cell_t * reserver_wait;
1195
-
1196
- reserver_wait = sync_array_find_thread (arr, reserver);
1197
-
1198
- if (reserver_wait &&
1199
- reserver_wait->latch .mutex != NULL &&
1200
- reserver_wait->waiting ) {
1201
- fputs (" InnoDB: Warning: Writer thread is waiting this semaphore:\n " ,
1202
- stderr);
1203
- reserver = (os_thread_id_t )ULINT_UNDEFINED;
1204
- sync_array_cell_print (stderr, reserver_wait, &reserver);
1205
- loop++;
1206
-
1207
- /* TODO: FIXME:
1208
- if (reserver_wait->thread == reserver) {
1209
- reserver = (os_thread_id_t)ULINT_UNDEFINED;
1210
- }
1211
- */
1212
- } else {
1213
- reserver = (os_thread_id_t )ULINT_UNDEFINED;
1214
- }
1215
-
1216
- /* This is protection against loop */
1217
- if (loop > 100 ) {
1218
- fputs (" InnoDB: Warning: Too many waiting threads.\n " , stderr);
1219
- break ;
1220
- }
1221
-
1222
- }
1183
+ ib::info () << " A semaphore wait:" ;
1184
+ sync_array_cell_print (stderr, cell);
1223
1185
}
1224
1186
}
1225
1187
@@ -1314,7 +1276,7 @@ sync_array_print_info_low(
1314
1276
1315
1277
if (cell->latch .mutex != 0 ) {
1316
1278
count++;
1317
- sync_array_cell_print (file, cell, 0 );
1279
+ sync_array_cell_print (file, cell);
1318
1280
}
1319
1281
}
1320
1282
}
@@ -1404,8 +1366,6 @@ sync_array_print_innodb(void)
1404
1366
for (i = 0 ; i < arr->n_cells ; i++) {
1405
1367
void * wait_object;
1406
1368
sync_cell_t * cell;
1407
- os_thread_id_t reserver=(os_thread_id_t )ULINT_UNDEFINED;
1408
- ulint loop=0 ;
1409
1369
1410
1370
cell = sync_array_get_nth_cell (arr, i);
1411
1371
@@ -1418,36 +1378,7 @@ sync_array_print_innodb(void)
1418
1378
1419
1379
fputs (" InnoDB: Warning: semaphore wait:\n " ,
1420
1380
stderr);
1421
- sync_array_cell_print (stderr, cell, &reserver);
1422
-
1423
- /* Try to output cell information for writer recursive way */
1424
- while (reserver != (os_thread_id_t )ULINT_UNDEFINED) {
1425
- sync_cell_t * reserver_wait;
1426
-
1427
- reserver_wait = sync_array_find_thread (arr, reserver);
1428
-
1429
- if (reserver_wait &&
1430
- reserver_wait->latch .mutex != NULL &&
1431
- reserver_wait->waiting ) {
1432
- fputs (" InnoDB: Warning: Writer thread is waiting this semaphore:\n " ,
1433
- stderr);
1434
- sync_array_cell_print (stderr, reserver_wait, &reserver);
1435
-
1436
- /* JAN: FIXME:
1437
- if (reserver_wait->thread == reserver) {
1438
- reserver = (os_thread_id_t)ULINT_UNDEFINED;
1439
- }
1440
- */
1441
- } else {
1442
- reserver = (os_thread_id_t )ULINT_UNDEFINED;
1443
- }
1444
-
1445
- /* This is protection against loop */
1446
- if (loop > 100 ) {
1447
- fputs (" InnoDB: Warning: Too many waiting threads.\n " , stderr);
1448
- break ;
1449
- }
1450
- }
1381
+ sync_array_cell_print (stderr, cell);
1451
1382
}
1452
1383
1453
1384
fputs (" InnoDB: Semaphore wait debug output ended:\n " , stderr);
0 commit comments