findWorkArea
This commit is contained in:
parent
4982a214da
commit
3316b0d338
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue