This commit is contained in:
aozhiwei 2019-12-13 21:01:53 +08:00
parent 1fe3f046e7
commit 7cfe69fdcd

View File

@ -47,8 +47,11 @@ public class Timer {
}
}
private static final int TVN_SIZE = 1 << 6;
private static final int TVR_SIZE = 1 << 8;
private static final boolean CONFIG_BASE_SMALL = false;
private static final int TVN_BITS = CONFIG_BASE_SMALL ? 4 : 6;
private static final int TVR_BITS = CONFIG_BASE_SMALL ? 6 : 8;
private static final int TVN_SIZE = 1 << TVN_BITS;
private static final int TVR_SIZE = 1 << TVR_BITS;
private static final int TVN_MASK = TVN_SIZE - 1;
private static final int TVR_MASK = TVR_SIZE - 1;
@ -82,6 +85,14 @@ public class Timer {
while (getTickCount.GetTickCount(content) >= timerTick) {
int index = (int)(timerTick & TVR_MASK);
if (index == 0 &&
cascade(tv2, (int)((timerTick >> (TVR_BITS + 0 * TVN_BITS)) & TVN_MASK)) == 0 &&
cascade(tv3, (int)((timerTick >> (TVR_BITS + 1 * TVN_BITS)) & TVN_MASK)) == 0 &&
cascade(tv4, (int)((timerTick >> (TVR_BITS + 2 * TVN_BITS)) & TVN_MASK)) == 0
) {
cascade(tv5, (int)((timerTick >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK));
}
++timerTick;
tv1[index].replaceInit(workList);
while (!workList.empty()) {
@ -215,4 +226,8 @@ public class Timer {
}
private int cascade(ListHead[] tv, int index) {
return 0;
}
}