From: mquinson Date: Tue, 20 May 2008 08:05:24 +0000 (+0000) Subject: Stupid us (as in Arnaud and me): we should not set sleep(-1) to sleep(MAXMIN_PRECISIO... X-Git-Tag: v3.3~495 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9c94047a774737b8f5384262706c265670a28a00 Stupid us (as in Arnaud and me): we should not set sleep(-1) to sleep(MAXMIN_PRECISION). the fix targets durations close to 0, not negative ones. This change broke almost all simulated examples. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5441 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/cpu.c b/src/surf/cpu.c index 3ba5717a39..64c1508601 100644 --- a/src/surf/cpu.c +++ b/src/surf/cpu.c @@ -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; - 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;