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

Function getsem

src/blkdev.cpp:279–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279static bool getsem (int unitnum, bool dowait)
280{
281 struct blkdevstate *st = &state[unitnum];
282 if (st->sema == NULL)
283 uae_sem_init (&st->sema, 0, 1);
284 bool gotit = false;
285 if (dowait) {
286 uae_sem_wait (&st->sema);
287 gotit = true;
288 } else {
289 gotit = uae_sem_trywait (&st->sema) == 0;
290 }
291 if (gotit)
292 st->sema_cnt++;
293 if (st->sema_cnt > 1)
294 write_log (_T("CD: unitsem%d acquire mismatch! cnt=%d\n"), unitnum, st->sema_cnt);
295 return gotit;
296}
297static bool getsem (int unitnum)
298{
299 return getsem (unitnum, false);

Callers 15

check_changesFunction · 0.85
audiostatusFunction · 0.85
sys_command_cd_pauseFunction · 0.85
sys_command_cd_stopFunction · 0.85
sys_command_cd_playFunction · 0.85
sys_command_cd_volumeFunction · 0.85
sys_command_cd_qcodeFunction · 0.85
sys_command_cd_tocFunction · 0.85
sys_command_cd_readFunction · 0.85
sys_command_cd_rawreadFunction · 0.85

Calls 2

uae_sem_initFunction · 0.85
write_logFunction · 0.70

Tested by

no test coverage detected