2 ms·
I totally agree. This is one of a number of concepts that keep me away from most GC'ed languages. BTW: Even in C++ though, I wouldn't use a pthread mutex direc
by StillBored 11y ago
I totally agree. This is one of a number of concepts that keep me away from most GC'ed languages.
BTW: Even in C++ though, I wouldn't use a pthread mutex directly, or in a wrapper class if I haven't banned exceptions. The "correct" way is to create a resource wrapper class without public lock/unlock calls and then a second RAII lock class that can lock/unlock the wrapper. Then if an exception happens while holding a lock you at least have a chance of properly unlocking it, or noticing that it wasn't unlocked.