About Computer Graphics and Game Development.
by
Use std::lock_guard
when possible.
std::lock_guard
is a RAII style lock that when current scope exit, the lock will automatically release, avoiding leaving mutex to be locked if exception occur in current scope.