process->socket_ = sockfd;
process->pid_ = pid;
process->running_ = true;
- process->status_ = 0;
process->memory_map_ = simgrid::xbt::get_memory_map(pid);
process->cache_flags = MC_PROCESS_CACHE_FLAG_NONE;
process->init_memory_map_info();
return running_;
}
- void terminate(int status)
+ void terminate()
{
- status_ = status;
running_ = false;
}
- int status() const
- {
- return status_;
- }
-
template<class M>
typename std::enable_if< std::is_class<M>::value && std::is_trivial<M>::value, int >::type
send_message(M const& m)
private:
pid_t pid_;
int socket_;
- int status_;
bool running_;
std::vector<simgrid::xbt::VmMap> memory_map_;
remote_ptr<void> maestro_stack_start_, maestro_stack_end_;
XBT_DEBUG("Shuting down model-checker");
simgrid::mc::Process* process = &mc_model_checker->process();
- int status = process->status();
if (process->running()) {
XBT_DEBUG("Killing process");
kill(process->pid(), SIGTERM);
- if (waitpid(process->pid(), &status, 0) == -1)
- throw std::system_error(errno, std::system_category());
- // TODO, handle the case when the process does not want to die with a timeout
- process->terminate(status);
+ process->terminate();
}
}
else if (WIFEXITED(status) || WIFSIGNALED(status)) {
XBT_DEBUG("Child process is over");
- mc_model_checker->process().terminate(status);
+ mc_model_checker->process().terminate();
}
}
}