boolean timedout = false;
long timeoutPeriod = edu.vt.rt.hyflow.benchmark.Benchmark.timout();
int count =0;
//this.aborts = ChronosScheduler.initAborts();
//this.aborts = edu.vt.rt.hyflow.benchmark.Benchmark.getAbortHandler();
Timespec deadline = new Timespec();
deadline.setTime(deadlineSec, deadlineNSec);
Timespec period_ts = new Timespec();
period_ts.setTime(period_tsSec, period_tsNSec);
Timespec currenttime = new Timespec();
ChronosScheduler.beginSegment(Priorities.TASK_RUN.getNativeId(), 2, deadline, period_ts, 0);
if(!rlock.tryAcquire(timeoutPeriod, TimeUnit.MILLISECONDS))
while(!rlock.tryAcquire(timeoutPeriod, TimeUnit.MILLISECONDS)) {
currenttime.getTime();
if(currenttime.greaterThan(deadline)) {
timedout = true;
break;
}
count++;
}