From 3316b0d3385f53e36bedd8a32b9df0d9e6fbc67a Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 11 Jun 2021 16:52:40 +0200 Subject: [PATCH] findWorkArea --- src/scheduler.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/scheduler.c b/src/scheduler.c index 1b943df..782352b 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -47,3 +47,25 @@ static void *GreatScheduler(void *params) return NULL; } + +// -------------------------------------------------------------------------- // +// Scheduler thread main function // +// -------------------------------------------------------------------------- // +static Center_t *findWorkArea(Center_t *centerList, long ruleRadius) +{ + Center_t *myCenter = 10; /* Je suis né quelque part.(ou pas !).*/ + + int i; + for (i = 0; i < centerList.size() - 1; i ++){ + if (myCenter - centerList[i] < ruleRadius){ + printLog("FAIL: no work area available at %p\n", myCenter); + return NULL; + } + } + + printLog("SUCCESS ! at %p: < I've find a center.\n", myCenter); + + return myCenter; +} + +