mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 13:03:04 +00:00
Timers: Improve OutboundMessageRegistry locking
SimpleTimer2 cleanups possible fix for ticket #1694
This commit is contained in:
1 parent
ef428d559e
commit
b15ea8ba2f
2 files changed
+17
-11
No files matched your search
@@ -330,12 +330,14 @@ public class OutboundMessageRegistry {
|
||||
if (r > 0 || e > 0 || a > 0)
|
||||
_log.debug("Expired: " + e + " remaining: " + r + " active: " + a);
|
||||
}
|
||||
if (_nextExpire <= now)
|
||||
_nextExpire = now + 10*1000;
|
||||
schedule(_nextExpire - now);
|
||||
synchronized(this) {
|
||||
if (_nextExpire <= now)
|
||||
_nextExpire = now + 10*1000;
|
||||
schedule(_nextExpire - now);
|
||||
}
|
||||
}
|
||||
|
||||
public void scheduleExpiration(MessageSelector sel) {
|
||||
public synchronized void scheduleExpiration(MessageSelector sel) {
|
||||
long now = _context.clock().now();
|
||||
if ( (_nextExpire <= now) || (sel.getExpiration() < _nextExpire) ) {
|
||||
_nextExpire = sel.getExpiration();
|
||||
|
||||
Reference in new issue
Block a user