+/* 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) */
/******************************************************************************/
/***************************** Bugged2 ****************************************/
/* This example implements a centralized mutual exclusion algorithm. */
/* One client stay always in critical section */
/* LTL property checked : !(GFcs) */
/******************************************************************************/
#include "bugged2_liveness.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
#include "bugged2_liveness.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
-int coordinator(int argc, char **argv);
-int client(int argc, char **argv);
-
-int coordinator(int argc, char *argv[])
+static 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);
XBT_INFO("CS already used.");
msg_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
MSG_task_send(answer, req);
msg_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
MSG_task_send(answer, req);
CS_used = 1;
msg_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
MSG_task_send(answer, req);
CS_used = 1;
- MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox),
- "coordinator");
+ MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox), "coordinator");
msg_task_t answer = NULL;
MSG_task_receive(&answer, my_mailbox);
kind = MSG_task_get_name(answer);
msg_task_t answer = NULL;
MSG_task_receive(&answer, my_mailbox);
kind = MSG_task_get_name(answer);
- 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);
MSG_function_register("client", client);
MSG_create_environment("../msg_platform.xml");
MSG_function_register("coordinator", coordinator);
MSG_function_register("client", client);