X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3c5b31c9766da42c82473b8c9dbf5910b74f3cb0..2568ec7bdc945fa4beebf200756910f8b5b7903a:/src/mc/mc_server.h diff --git a/src/mc/mc_server.h b/src/mc/mc_server.h index 559d0850b7..7a54eccc1a 100644 --- a/src/mc/mc_server.h +++ b/src/mc/mc_server.h @@ -4,32 +4,34 @@ /* 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. */ -#ifndef MC_SERVER_H -#define MC_SERVER_H +#ifndef SIMGRID_MC_SERVER_H +#define SIMGRID_MC_SERVER_H + +#include + +#include +#include + +#include +#include #include + +#include "mc_process.h" +#include "mc_exit.h" SG_BEGIN_DECL() -#define MC_SERVER_ERROR 127 +#define MC_SERVER_ERROR SIMGRID_ERROR typedef struct s_mc_server s_mc_server_t, *mc_server_t; extern mc_server_t mc_server; -/** Initialise MC server - * - * @param PID of the model-checked process - * @param socket file descriptor for communication with the model-checked process - * @return 0 on success - */ -int MC_server_init(pid_t pid, int socket); +XBT_INTERNAL void MC_server_wait_client(simgrid::mc::Process* process); +XBT_INTERNAL void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value); -/** Execute the MC server - * - * @return Status code (can be used with `exit()`) - */ -void MC_server_run(void); +XBT_INTERNAL void MC_server_loop(mc_server_t server); SG_END_DECL() @@ -45,9 +47,9 @@ public: void start(); void shutdown(); void exit(); - void resume(mc_process_t process); + void resume(simgrid::mc::Process* process); void loop(); - void handle_events(); + bool handle_events(); protected: void handle_signals(); void handle_waitpid();