3 ms·
Oh 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 in
by lionkor 2y ago
Oh 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.