Lines 1419-1424
Link Here
|
1419 |
Item scheduled = this.item; |
1419 |
Item scheduled = this.item; |
1420 |
if (scheduled != null && scheduled.getTask() == this) { |
1420 |
if (scheduled != null && scheduled.getTask() == this) { |
1421 |
// do not mark as finished, we are scheduled for future |
1421 |
// do not mark as finished, we are scheduled for future |
|
|
1422 |
if (time != 0) { |
1423 |
long reschedule = time - System.currentTimeMillis(); |
1424 |
if (reschedule < 0) { |
1425 |
reschedule = 0; |
1426 |
} |
1427 |
time = 0; |
1428 |
schedule(reschedule); |
1429 |
} |
1422 |
} else { |
1430 |
} else { |
1423 |
notifyFinished(); |
1431 |
notifyFinished(); |
1424 |
} |
1432 |
} |
Lines 1460-1466
Link Here
|
1460 |
throw new IllegalStateException("RequestProcessor already stopped!"); // NOI18N |
1468 |
throw new IllegalStateException("RequestProcessor already stopped!"); // NOI18N |
1461 |
} |
1469 |
} |
1462 |
|
1470 |
|
1463 |
time = System.currentTimeMillis() + delay; |
1471 |
long localTime = System.currentTimeMillis() + delay; |
1464 |
|
1472 |
|
1465 |
final Item localItem; |
1473 |
final Item localItem; |
1466 |
|
1474 |
|
Lines 1470-1483
Link Here
|
1470 |
} |
1478 |
} |
1471 |
notifyRunning(); |
1479 |
notifyRunning(); |
1472 |
|
1480 |
|
|
|
1481 |
boolean scheduleLater = false; |
1473 |
if (item != null) { |
1482 |
if (item != null) { |
1474 |
item.clear(null); |
1483 |
scheduleLater = !item.clear(null) || time > 0; |
1475 |
} |
1484 |
} |
1476 |
|
1485 |
|
|
|
1486 |
time = localTime; |
1487 |
|
1477 |
item = enableStackTraces ? |
1488 |
item = enableStackTraces ? |
1478 |
new SlowItem(this, RequestProcessor.this) : |
1489 |
new SlowItem(this, RequestProcessor.this) : |
1479 |
new FastItem(this, RequestProcessor.this); |
1490 |
new FastItem(this, RequestProcessor.this); |
|
|
1491 |
|
1492 |
if (scheduleLater) { |
1493 |
return; |
1494 |
} |
1495 |
|
1480 |
localItem = item; |
1496 |
localItem = item; |
|
|
1497 |
|
1481 |
} |
1498 |
} |
1482 |
|
1499 |
|
1483 |
if (delay == 0) { // Place it to pending queue immediatelly |
1500 |
if (delay == 0) { // Place it to pending queue immediatelly |
Lines 1944-1949
Link Here
|
1944 |
synchronized (current.processorLock) { |
1961 |
synchronized (current.processorLock) { |
1945 |
todo = current.askForWork(this, debug); |
1962 |
todo = current.askForWork(this, debug); |
1946 |
if (todo == null) break; |
1963 |
if (todo == null) break; |
|
|
1964 |
todo.time = 0; |
1947 |
} |
1965 |
} |
1948 |
setPrio(todo.getPriority()); |
1966 |
setPrio(todo.getPriority()); |
1949 |
|
1967 |
|