| 2468 | } |
| 2469 | |
| 2470 | static void close_device (int unitnum) |
| 2471 | { |
| 2472 | struct cdunit *cdu = &cdunits[unitnum]; |
| 2473 | if (cdu->open) { |
| 2474 | cdda_stop (cdu); |
| 2475 | cdu->open = false; |
| 2476 | if (cdimage_unpack_thread) { |
| 2477 | cdimage_unpack_thread = 0; |
| 2478 | write_comm_pipe_u32 (&unpack_pipe, -1, 0); |
| 2479 | write_comm_pipe_u32 (&unpack_pipe, -1, 1); |
| 2480 | while (cdimage_unpack_thread == 0) |
| 2481 | Sleep (10); |
| 2482 | cdimage_unpack_thread = 0; |
| 2483 | destroy_comm_pipe (&unpack_pipe); |
| 2484 | } |
| 2485 | unload_image (cdu); |
| 2486 | uae_sem_destroy (&cdu->sub_sem); |
| 2487 | } |
| 2488 | blkdev_cd_change (unitnum, cdu->imgname_out); |
| 2489 | } |
| 2490 | |
| 2491 | static void close_bus (void) |
| 2492 | { |
no test coverage detected