Reimplement with boost boost::file_lock