X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4e78565ea6b354a0e6250a87b483f909665a0ac3..f2ad0175ed569f3cfa5df330ec4174d7fe7b1229:/examples/msg/mc/bugged2_liveness.c diff --git a/examples/msg/mc/bugged2_liveness.c b/examples/msg/mc/bugged2_liveness.c index 7117b49b79..e13dd5ab70 100644 --- a/examples/msg/mc/bugged2_liveness.c +++ b/examples/msg/mc/bugged2_liveness.c @@ -1,10 +1,16 @@ +/* Copyright (c) 2012-2015. 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. */ + /***************************** Bugged2 ****************************************/ /* This example implements a centralized mutual exclusion algorithm. */ /* One client stay always in critical section */ /* LTL property checked : !(GFcs) */ /******************************************************************************/ -#include "msg/msg.h" +#include "simgrid/msg.h" #include "mc/mc.h" #include "xbt/automaton.h" #include "bugged2_liveness.h" @@ -13,11 +19,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages"); int cs = 0; -int predCS(){ - return cs; -} - - int coordinator(int argc, char **argv); int client(int argc, char **argv); @@ -35,7 +36,6 @@ int coordinator(int argc, char *argv[]) XBT_INFO("CS already used."); msg_task_t answer = MSG_task_create("not grant", 0, 1000, NULL); MSG_task_send(answer, req); - MC_compare(); } else { // can serve it immediatly XBT_INFO("CS idle. Grant immediatly"); msg_task_t answer = MSG_task_create("grant", 0, 1000, NULL); @@ -97,8 +97,7 @@ int main(int argc, char *argv[]) MSG_init(&argc, argv); - MSG_config("model-check/property","promela_bugged2_liveness"); - MC_automaton_new_propositional_symbol("cs", &predCS); + MC_automaton_new_propositional_symbol_pointer("cs", &cs); MSG_create_environment("../msg_platform.xml"); MSG_function_register("coordinator", coordinator);