-/* Copyright (c) 2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2015-2019. 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. */
* and the MC does not find the counter-example.
*/
-#include "mc/mc.h"
+#include "simgrid/modelchecker.h"
#include "simgrid/msg.h"
#include <xbt/synchro.h>
#define BOX_NAME "box"
#ifndef DISABLE_THE_MUTEX
-static xbt_mutex_t mutex = NULL;
+static sg_mutex_t mutex = NULL;
#endif
-static int receiver(int argc, char *argv[])
+static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
{
msg_task_t task = NULL;
static int sender(int argc, char *argv[])
{
+ xbt_assert(argc == 2);
char* message_name = argv[1];
#ifndef DISABLE_THE_MUTEX
- xbt_mutex_acquire(mutex);
+ sg_mutex_lock(mutex);
#endif
MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME);
#ifndef DISABLE_THE_MUTEX
- xbt_mutex_release(mutex);
+ sg_mutex_unlock(mutex);
#endif
return 0;
}
MSG_launch_application(argv[2]);
#ifndef DISABLE_THE_MUTEX
- mutex = xbt_mutex_init();
+ mutex = sg_mutex_init();
#endif
msg_error_t res = MSG_main();
#ifndef DISABLE_THE_MUTEX
- xbt_mutex_destroy(mutex); mutex = NULL;
+ sg_mutex_destroy(mutex);
+ mutex = NULL;
#endif
XBT_INFO("Simulation time %g", MSG_get_clock());