Create RAII and mutex