The empty class std::try_to_lock can be used to alter the behaviour of lock_guard (and other similar types), so that it doesn\'t block if the mutex is already locked: for ex