X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4725d7a4bc5ac1fdae3e86222cdc23eaaf6fb226..fd92747951bee810d382edb735052a6b56db1c6d:/src/xbt/xbt_sg_time.c diff --git a/src/xbt/xbt_sg_time.c b/src/xbt/xbt_sg_time.c index 84ba8dfed7..c8ea62efc1 100644 --- a/src/xbt/xbt_sg_time.c +++ b/src/xbt/xbt_sg_time.c @@ -1,8 +1,7 @@ -/* $Id$ */ - /* time - time related syscal wrappers */ -/* Copyright (c) 2003-2007 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2007, 2008, 2009, 2010. 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. */ @@ -12,20 +11,22 @@ /* * Time elapsed since the begining of the simulation. */ -double xbt_time() { +double xbt_time() +{ return SIMIX_get_clock(); } /* * Freeze the process for the specified amount of time */ -void xbt_sleep(double sec) { +void xbt_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); + act_sleep = SIMIX_action_sleep(SIMIX_process_get_host(proc), sec); mutex = SIMIX_mutex_init(); SIMIX_mutex_lock(mutex); @@ -33,7 +34,7 @@ void xbt_sleep(double sec) { cond = SIMIX_cond_init(); SIMIX_register_action_to_condition(act_sleep, cond); - SIMIX_cond_wait(cond,mutex); + SIMIX_cond_wait(cond, mutex); SIMIX_mutex_unlock(mutex); /* remove variables */