Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv msg/msg.h simgrid/msg.h
[simgrid.git] / examples / msg / semaphores / synchro.c
index b63a759..01dcd02 100644 (file)
@@ -1,6 +1,12 @@
+/* Copyright (c) 2013-2014. 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. */
+
 #include <stdio.h>
 #include <stdlib.h>
-#include "msg/msg.h"
+#include "simgrid/msg.h"
 #include "xbt/log.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_semaphore_example,
@@ -8,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_semaphore_example,
 
 msg_sem_t sem;
 
-int peer(int argc, char* argv[]){
+static int peer(int argc, char* argv[]){
 
   int i = 0; 
   
@@ -27,6 +33,8 @@ int peer(int argc, char* argv[]){
   }
   MSG_process_sleep(50);
   XBT_INFO("Done");
+
+  return 0;
 }
 
 int main(int argc, char* argv[]) {
@@ -70,5 +78,5 @@ int main(int argc, char* argv[]) {
 
   msg_error_t res = MSG_main();
   printf("Finished\n");
-  return 0;
+  return (res != MSG_OK);
 }