Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add isend in Task
[simgrid.git] / org / simgrid / msg / Process.java
index 7289d96..2aceb10 100644 (file)
@@ -14,6 +14,7 @@ package org.simgrid.msg;
 import java.util.Arrays;
 import java.util.Hashtable;
 import java.util.Vector;
+import java.util.concurrent.Semaphore;
 
 /**
  * A process may be defined as a code, with some private data, executing 
@@ -99,13 +100,9 @@ public abstract class Process extends Thread {
        public Vector<String> args;
 
        /* process synchronization tools */
-    /**
-     *
-     */
-    /**
-     *
-     */
-    protected Sem schedBegin, schedEnd;
+       
+       /* give the full path to semaphore to ensure that our own implementation don't get selected */
+    protected java.util.concurrent.Semaphore schedBegin, schedEnd;
     private boolean nativeStop = false;
 
        /**
@@ -118,8 +115,8 @@ public abstract class Process extends Thread {
                this.bind = 0;
                this.args = new Vector<String>();
                this.properties = null;
-               schedBegin = new Sem(0);
-               schedEnd = new Sem(0);
+               schedBegin = new java.util.concurrent.Semaphore(0);
+               schedEnd = new java.util.concurrent.Semaphore(0);
        }
 
 
@@ -185,7 +182,11 @@ public abstract class Process extends Thread {
                if (null != args)
                        this.args.addAll(Arrays.asList(args));
 
-               MsgNative.processCreate(this, host);
+               try {
+                       MsgNative.processCreate(this, host.getName());
+               } catch (HostNotFoundException e) {
+                       throw new RuntimeException("The impossible happened (yet again): the host that I have were not found",e);
+               }
                
        }