cache.c
// Would be better to use a semaphore, but otherwise we don't knowwhen we could quit because there is no cleanup API.
Would be better to use a semaphore, but otherwise we don't knowwhen we could quit because there is no cleanup API.
Would be better to use a semaphore but otherwise we don ' t knowwhen we could quit because there is no cleanup API .
void* HarvesterThread(void *cache) {
    cache_t* hostCache = (cache_t*)cache;
    while(true){
        if (need_to_harvest) {
            Harvest(hostCache);
            need_to_harvest = false;
        }
        sleep(10);
    }
    return NULL;
}
void * HarvesterThread ( void * cache ) { cache_t * hostCache = ( cache_t * ) cache ; while ( true ) { if ( need_to_harvest ) { Harvest ( hostCache ) ; need_to_harvest = false ; } sleep ( 10 ) ; } return NULL ; }
Would be better to use a semaphore, but otherwise we don't knowwhen we could quit because there is no cleanup API.
Would be better to use a semaphore but otherwise we don ' t knowwhen we could quit because there is no cleanup API .
//sem_wait(hostCache->OccupancyMonitor);