X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ac9197eec3a25524040ce2f55021ba590788c3a3..2e6a2f4d67dd98932d53dade7d9f4a01ded1401d:/src/mc/ModelChecker.hpp diff --git a/src/mc/ModelChecker.hpp b/src/mc/ModelChecker.hpp index 52d068fa50..e9741ec8d4 100644 --- a/src/mc/ModelChecker.hpp +++ b/src/mc/ModelChecker.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -6,6 +6,7 @@ #ifndef SIMGRID_MC_MODEL_CHECKER_HPP #define SIMGRID_MC_MODEL_CHECKER_HPP +#include "src/mc/remote/CheckerSide.hpp" #include "src/mc/sosp/PageStore.hpp" #include "xbt/base.h" @@ -13,30 +14,24 @@ #include #include -#include - namespace simgrid { namespace mc { /** State of the model-checker (global variables for the model checker) */ class ModelChecker { - struct event_base* base_ = nullptr; - struct event* socket_event_ = nullptr; - struct event* signal_event_ = nullptr; + CheckerSide event_loop_; /** String pool for host names */ - // TODO, use std::set with heterogeneous comparison lookup (C++14)? std::set hostnames_; // This is the parent snapshot of the current state: PageStore page_store_{500}; std::unique_ptr process_; Checker* checker_ = nullptr; -public: +public: ModelChecker(ModelChecker const&) = delete; ModelChecker& operator=(ModelChecker const&) = delete; explicit ModelChecker(std::unique_ptr process); - ~ModelChecker(); RemoteClient& process() { return *process_; } PageStore& page_store() @@ -52,10 +47,10 @@ public: void start(); void shutdown(); void resume(simgrid::mc::RemoteClient& process); - void loop(); void handle_events(int fd, short events); void wait_for_requests(); void handle_simcall(Transition const& transition); + XBT_ATTRIB_NORETURN void exit(int status); bool checkDeadlock(); @@ -67,7 +62,6 @@ private: void setup_ignore(); bool handle_message(const char* buffer, ssize_t size); void handle_waitpid(); - void on_signal(int signo); public: unsigned long visited_states = 0;