MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / close_device

Function close_device

src/blkdev_cdimage.cpp:2470–2489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2468}
2469
2470static 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
2491static void close_bus (void)
2492{

Callers 1

close_busFunction · 0.70

Calls 6

cdda_stopFunction · 0.85
write_comm_pipe_u32Function · 0.85
destroy_comm_pipeFunction · 0.85
unload_imageFunction · 0.85
uae_sem_destroyFunction · 0.85
blkdev_cd_changeFunction · 0.85

Tested by

no test coverage detected