Added lock and unlock method for render targets