Hacker News new | ask | show | jobs
by MontagFTB 1173 days ago
In C++, RAII locking/unlocking also handles exceptions thrown across the lock seamlessly. Otherwise all lock work would have to be try/catch wrapped and handled correctly.
1 comments

> Otherwise all lock work would have to be try/catch wrapped and handled correctly.

Alternatively, you could ensure your codebase does not use exceptions. (Which is common for "C-style" programmers like GP.)