Revision 6b81f4fa src/sim/cspinningthreadpool.cc

View differences:

src/sim/cspinningthreadpool.cc
44 44
}
45 45

  
46 46
cSpinningThreadPool::cSpinningThreadPool() :
47
    useMainThread(false), barrierMin(0)
47
    useMainThread(false), barrierMin(-1)
48 48
{
49 49
    AO_store(&cancel, 0);
50 50
}
......
207 207
    } while (true);
208 208
}
209 209
#undef BARRIERVALID
210

  
210
/*
211
 * TODO: also update barrierMin if not vaild anymore
212
 */
211 213
bool cSpinningThreadPool::isBeforeBarrier(cMessage* msg) {
212
    return (barrierMin >= 0 && threadStates[barrierMin*SPACING] < *msg);
214
    return (barrierMin >=0 && threadStates[barrierMin*SPACING] < *msg);
215
    /*
216
    if (barrierMin >=0) {
217
        printf("barriertime=%f ",SIMTIME_DBL(threadStates[barrierMin*SPACING].barrierTime));
218
        return (threadStates[barrierMin*SPACING] < *msg);
219
    }
220
    return false; //is this correct?*/
213 221
}
214 222

  
215 223
Register_PerRunConfigOption(CFGID_SPINNING_THREADPOOL_THREAD_POOL_SIZE, "thread-pool-size", CFG_INT, "5", "Number of worker threads");

Also available in: Unified diff