3 ms·
Thanks for digging that up. It looks like the mutex is theoretically sound.. unlocked before all returns, as long as there isn't an exception raised in between
by metadat 2y ago
Thanks for digging that up.
It looks like the mutex is theoretically sound.. unlocked before all returns, as long as there isn't an exception raised in between. I wonder what the parent comment's issue is.
- lionkor 2y agoOh yeah of course its sound, but this is not how you write C code, because all it takes is for someone else in 10 years to, somewhere between 51000 and 53000 introduce an early return statement and forget to unlock that mutex, or other little things. This is solved in C usually with a goto to a cleanup routine, and avoiding early returns.