Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stupid us (as in Arnaud and me): we should not set sleep(-1) to sleep(MAXMIN_PRECISIO...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 May 2008 08:05:24 +0000 (08:05 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 May 2008 08:05:24 +0000 (08:05 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5441 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/cpu.c

index 3ba5717..64c1508 100644 (file)
@@ -304,7 +304,8 @@ static surf_action_t execute(void *cpu, double size)
 static surf_action_t action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_Cas01_t action = NULL;
 static surf_action_t action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_Cas01_t action = NULL;
-  duration=MAX(duration,MAXMIN_PRECISION);
+  if (duration>0)
+     duration=MAX(duration,MAXMIN_PRECISION);
   XBT_IN2("(%s,%g)", ((cpu_Cas01_t) cpu)->name, duration);
   action = (surf_action_cpu_Cas01_t) execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   XBT_IN2("(%s,%g)", ((cpu_Cas01_t) cpu)->name, duration);
   action = (surf_action_cpu_Cas01_t) execute(cpu, 1.0);
   action->generic_action.max_duration = duration;