Locked Forever
std::mutex m;
std::vector<int> load(const char* path) {
m.lock();
std::FILE* f = std::fopen(path, "rb");
auto data = parse(f); // may throw std::runtime_error
std::fclose(f);
m.unlock();
return data;
}
parse throws on a malformed file. What is the state of the process afterwards?
Sign in to answer questions and track your progress
Sign In