+
+ } else {
+ DEBUG4("%s(%p) here! killing %s(%p)",
+ simix_global->current_process->name,simix_global->current_process,
+ process->name,process);
+
+ /* Cleanup if it were waiting for something */
+ if (process->mutex) {
+ xbt_swag_remove(process, process->mutex->sleeping);
+ process->mutex = NULL;
+ }
+
+ if (process->cond) {
+ xbt_swag_remove(process, process->cond->sleeping);
+
+ if (process->waiting_action) {
+ SIMIX_unregister_action_to_condition(process->waiting_action, process->cond);
+ SIMIX_action_destroy(process->waiting_action);
+ }
+ process->cond = NULL;
+ }
+
+ if (process->sem) {
+ xbt_fifo_remove(process->sem->sleeping, process);
+
+ if (process->waiting_action) {
+ SIMIX_unregister_action_to_semaphore(process->waiting_action, process->sem);
+ SIMIX_action_destroy(process->waiting_action);
+ }
+ process->sem = NULL;
+ }
+
+ /* make sure that the process gets awake soon enough, now that we've set its iwannadie to 1 */
+ process->blocked = 0;
+ process->suspended = 0;
+ xbt_swag_insert(process, simix_global->process_to_run);
+ }