| 1364 | |
| 1365 | |
| 1366 | static void prt_owner(OUTFILE outfile, |
| 1367 | const lhb* LOCK_header, |
| 1368 | const own* owner, |
| 1369 | bool sw_requests, |
| 1370 | bool sw_waitlist, |
| 1371 | bool sw_pending) |
| 1372 | { |
| 1373 | /************************************** |
| 1374 | * |
| 1375 | * p r t _ o w n e r |
| 1376 | * |
| 1377 | ************************************** |
| 1378 | * |
| 1379 | * Functional description |
| 1380 | * Print a formatted owner block. |
| 1381 | * |
| 1382 | **************************************/ |
| 1383 | const prc* process = (prc*) SRQ_ABS_PTR(owner->own_process); |
| 1384 | |
| 1385 | if (!sw_html_format) |
| 1386 | FPRINTF(outfile, "OWNER BLOCK %6" SLONGFORMAT"\n", SRQ_REL_PTR(owner)); |
| 1387 | else |
| 1388 | { |
| 1389 | const SLONG rel_owner = SRQ_REL_PTR(owner); |
| 1390 | FPRINTF(outfile, "<a name=\"%s%" SLONGFORMAT"\">OWNER BLOCK %6" SLONGFORMAT"</a>\n", |
| 1391 | preOwn, rel_owner, rel_owner); |
| 1392 | } |
| 1393 | FPRINTF(outfile, "\tOwner id: %6" QUADFORMAT"d, Type: %1d\n", |
| 1394 | owner->own_owner_id, owner->own_owner_type); |
| 1395 | |
| 1396 | FPRINTF(outfile, "\tProcess id: %6d (%s), Thread id: %6" SIZEFORMAT"\n", |
| 1397 | process->prc_process_id, |
| 1398 | ISC_check_process_existence(process->prc_process_id) ? "Alive" : "Dead", |
| 1399 | // please keep C-cast here - own_thread_id type varies great from OS to OS |
| 1400 | (size_t) owner->own_thread_id); |
| 1401 | |
| 1402 | const USHORT flags = owner->own_flags; |
| 1403 | FPRINTF(outfile, "\tFlags: 0x%02X ", flags); |
| 1404 | FPRINTF(outfile, " %s", (flags & OWN_wakeup) ? "wake" : " "); |
| 1405 | FPRINTF(outfile, " %s", (flags & OWN_scanned) ? "scan" : " "); |
| 1406 | FPRINTF(outfile, " %s", (flags & OWN_signaled) ? "sgnl" : " "); |
| 1407 | FPRINTF(outfile, "\n"); |
| 1408 | |
| 1409 | prt_que(outfile, LOCK_header, "\tRequests", &owner->own_requests, |
| 1410 | offsetof(lrq, lrq_own_requests), preRequest); |
| 1411 | prt_que(outfile, LOCK_header, "\tBlocks", &owner->own_blocks, |
| 1412 | offsetof(lrq, lrq_own_blocks), preRequest); |
| 1413 | prt_que(outfile, LOCK_header, "\tPending", &owner->own_pending, |
| 1414 | offsetof(lrq, lrq_own_pending), preRequest); |
| 1415 | |
| 1416 | if (sw_waitlist) |
| 1417 | { |
| 1418 | waitque owner_list; |
| 1419 | owner_list.waitque_depth = 0; |
| 1420 | prt_owner_wait_cycle(outfile, LOCK_header, owner, 8, &owner_list); |
| 1421 | } |
| 1422 | |
| 1423 | FPRINTF(outfile, "\n"); |
no test coverage detected