findWorkArea

This commit is contained in:
Jean Sirmai 2021-06-11 16:52:40 +02:00
parent 4982a214da
commit 3316b0d338
Signed by untrusted user who does not match committer: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 22 additions and 0 deletions

View File

@ -47,3 +47,25 @@ static void *GreatScheduler(void *params)
return NULL; 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;
}