A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
only use public headers from MC examples too
[simgrid.git]
/
examples
/
msg
/
mc
/
bugged2_liveness.c
diff --git
a/examples/msg/mc/bugged2_liveness.c
b/examples/msg/mc/bugged2_liveness.c
index
da785bb
..
5a6d2d2
100644
(file)
--- a/
examples/msg/mc/bugged2_liveness.c
+++ b/
examples/msg/mc/bugged2_liveness.c
@@
-1,5
+1,4
@@
-/* Copyright (c) 2012-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2012-2018. 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. */
/* 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. */
@@
-10,10
+9,8
@@
/* LTL property checked : !(GFcs) */
/******************************************************************************/
/* LTL property checked : !(GFcs) */
/******************************************************************************/
-#include "simgrid/msg.h"
-#include "mc/mc.h"
-#include "xbt/automaton.h"
-#include "bugged2_liveness.h"
+#include <simgrid/modelchecker.h>
+#include <simgrid/msg.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
@@
-29,12
+26,12
@@
static int coordinator(int argc, char *argv[])
const char *kind = MSG_task_get_name(task); //is it a request or a release?
if (!strcmp(kind, "request")) { // that's a request
char *req = MSG_task_get_data(task);
const char *kind = MSG_task_get_name(task); //is it a request or a release?
if (!strcmp(kind, "request")) { // that's a request
char *req = MSG_task_get_data(task);
- if (CS_used) {
+ if (CS_used) {
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);
- } else { // can serve it immediatly
- XBT_INFO("CS idle. Grant immediatly");
+ } else { // can serve it immediat
e
ly
+ XBT_INFO("CS idle. Grant immediat
e
ly");
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;
@@
-54,7
+51,6
@@
static int client(int argc, char *argv[])
{
int my_pid = MSG_process_get_PID(MSG_process_self());
char *my_mailbox = xbt_strdup(argv[1]);
{
int my_pid = MSG_process_get_PID(MSG_process_self());
char *my_mailbox = xbt_strdup(argv[1]);
- const char* kind;
while(1){
XBT_INFO("Client (%s) asks the request", my_mailbox);
while(1){
XBT_INFO("Client (%s) asks the request", my_mailbox);
@@
-63,7
+59,7
@@
static int client(int argc, char *argv[])
msg_task_t answer = NULL;
MSG_task_receive(&answer, my_mailbox);
msg_task_t answer = NULL;
MSG_task_receive(&answer, my_mailbox);
- kind = MSG_task_get_name(answer);
+
const char*
kind = MSG_task_get_name(answer);
if (!strcmp(kind, "grant")) {
XBT_INFO("Client (%s) got the answer (grant). Sleep a bit and release it", my_mailbox);
if (!strcmp(kind, "grant")) {
XBT_INFO("Client (%s) got the answer (grant). Sleep a bit and release it", my_mailbox);