Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename SIMIX files
[simgrid.git] / src / simix / smx_process.c
index c698c7c..af808cc 100644 (file)
@@ -4,7 +4,7 @@
 /* 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 "private.h"
+#include "smx_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
@@ -284,8 +284,8 @@ void SIMIX_process_kill(smx_process_t process) {
        break;
 
       case SIMIX_ACTION_IO:
-       THROW_UNIMPLEMENTED;
-       break;
+        SIMIX_io_destroy(process->waiting_action);
+        break;
     }
   }
 
@@ -644,7 +644,21 @@ void SIMIX_process_set_context(smx_process_t p,smx_context_t c) {
 /**
  * \brief Returns the list of processes to run.
  */
-XBT_INLINE xbt_dynar_t SIMIX_process_get_runnable(void)
+xbt_dynar_t SIMIX_process_get_runnable(void)
 {
   return simix_global->process_to_run;
 }
+
+/**
+ * \brief Returns the process from PID.
+ */
+smx_process_t SIMIX_process_from_PID(int PID)
+{
+       smx_process_t proc;
+       xbt_swag_foreach(proc, simix_global->process_list)
+       {
+        if(proc->pid == PID)
+        return proc;
+       }
+       return NULL;
+}