std::unique_lock for such cases - more maintainable alternative