3 ms·
https://github.com/quickjs-ng/quickjs/blob/b071d36ab561a85fad11f487f875aba2d25b5ccd/quickjs.c#L52282 https://github.com/quickjs-ng/quickjs/blob/b071d36ab561a85f
by lionkor 2y ago
https://github.com/quickjs-ng/quickjs/blob/b071d36ab561a85fad11f487f875aba2d25b5ccd/quickjs.c#L52282 https://github.com/quickjs-ng/quickjs/blob/b071d36ab561a85fa...
- metadat 2y agoThanks 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.