From 66e2d3a2ec0655ff9c8347836f63af9c5b67436a Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 19 Mar 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-03-19 --- port/devrealtime.c | 9 ++++++--- port/edf.c | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/port/devrealtime.c b/port/devrealtime.c index 84cd9b48e8ae9047c2514e2bacad5b9c08cb41ca..1a09d1eb55358bcde9de9f7243792744262de7dc 100644 --- a/port/devrealtime.c +++ b/port/devrealtime.c @@ -639,6 +639,7 @@ devrtwrite(Chan *c, void *va, long n, vlong) a = args[i]; add = 0; if (v = strchr(a, '=')){ + *v = '\0'; if (v != a && v[-1] == '+'){ add = 1; v[-1] = '\0'; @@ -646,7 +647,7 @@ devrtwrite(Chan *c, void *va, long n, vlong) add = -1; v[-1] = '\0'; } - *v++ = '\0'; + v++; } if (strcmp(a, "T") == 0){ if (e=parsetime(&time, v)) @@ -690,12 +691,14 @@ devrtwrite(Chan *c, void *va, long n, vlong) }else if (strcmp(a, "procs") == 0){ if (v == nil) error("procs: value missing"); - if (add <= 0) + if (add <= 0){ edf_expel(t); + } if (add == 0){ for (pp = t->procs; pp < t->procs + nelem(t->procs); pp++) - if (*pp) + if (*pp){ proctotask(t, *pp, -1); + } add = 1; } nrargs = tokenize(v, rargs, nelem(rargs)); diff --git a/port/edf.c b/port/edf.c index 56ea4fd41912da268cbaaffe24979ac70c03be56..33ed2e605c2cbc3772c5358d1fc185e7d31609ed 100644 --- a/port/edf.c +++ b/port/edf.c @@ -777,6 +777,8 @@ static Lock waitlock; int edf_waitlock(Lock *l) { + Task *t; + iprint("edf_waitlock\n"); ilock(&waitlock); /* can't afford normal locks here */ if (l->key == 0){