X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/86188201e4a5e76f7e0131c71f700b638458e9c9..bc911012d7b8acd058eb71df52b6a2686bb4f8ef:/src/gras/Virtu/sg_time.c diff --git a/src/gras/Virtu/sg_time.c b/src/gras/Virtu/sg_time.c index 56f8c35211..60d43c5f7c 100644 --- a/src/gras/Virtu/sg_time.c +++ b/src/gras/Virtu/sg_time.c @@ -7,39 +7,3 @@ /* 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 "gras/Virtu/virtu_sg.h" - -/* - * Time elapsed since the begining of the simulation. - */ -double gras_os_time() { - return SIMIX_get_clock(); -} - -/* - * Freeze the process for the specified amount of time - */ -void gras_os_sleep(double sec) { - smx_action_t act_sleep; - smx_process_t proc = SIMIX_process_self(); - smx_mutex_t mutex; - smx_cond_t cond; - /* create action to sleep */ - act_sleep = SIMIX_action_sleep(SIMIX_process_get_host(proc),sec); - - mutex = SIMIX_mutex_init(); - SIMIX_mutex_lock(mutex); - /* create conditional and register action to it */ - cond = SIMIX_cond_init(); - - SIMIX_register_condition_to_action(act_sleep, cond); - SIMIX_register_action_to_condition(act_sleep, cond); - SIMIX_cond_wait(cond,mutex); - SIMIX_mutex_unlock(mutex); - - /* remove variables */ - SIMIX_cond_destroy(cond); - SIMIX_mutex_destroy(mutex); - SIMIX_action_destroy(act_sleep); - -}