use RAII AutoSync