Closed reticulatedpines closed 1 month ago
This was a combination of mistakes. take_semaphore() hasn't changed behaviour here, but we were mistakenly creating the sem locked, so it would deadlock if you called the first take with 0 as 2nd param, since that is "wait forever".
As part of the fix I introduced SEM_CREATE_LOCKED and SEM_CREATE_UNLOCKED enums for create_named_semaphore(), to make it harder to get this wrong in future - and make the code clearer to read.
I think critix might have spotted this. Here's my comment from dual_iso.c:
isoless_sem is one we make ourselves, so I'd guess this is an API change on Canon's side.
We should audit all our uses of take_semaphore() and see if the problem happens elsewhere. Potentially this could break a lot of things.