Allow subclasses to configure the lock timeout.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6666 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1371,6 +1371,15 @@ public abstract class PeerManager
|
|||||||
listener.requestCompleted(null);
|
listener.requestCompleted(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the amount of time to wait for peer ratification to complete before
|
||||||
|
* acquiring/releasing a lock.
|
||||||
|
*/
|
||||||
|
protected long getLockTimeout ()
|
||||||
|
{
|
||||||
|
return DEFAULT_LOCK_TIMEOUT;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a lock in a state of resolution.
|
* Handles a lock in a state of resolution.
|
||||||
*/
|
*/
|
||||||
@@ -1408,7 +1417,7 @@ public abstract class PeerManager
|
|||||||
_stats.lockTimeouts++;
|
_stats.lockTimeouts++;
|
||||||
activate();
|
activate();
|
||||||
}
|
}
|
||||||
})).schedule(LOCK_TIMEOUT);
|
})).schedule(getLockTimeout());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1653,6 +1662,6 @@ public abstract class PeerManager
|
|||||||
@Inject protected PresentsDObjectMgr _omgr;
|
@Inject protected PresentsDObjectMgr _omgr;
|
||||||
@Inject protected ReportManager _repmgr;
|
@Inject protected ReportManager _repmgr;
|
||||||
|
|
||||||
/** We wait this long for peer ratification to complete before acquiring/releasing the lock. */
|
/** The default lock timeout. */
|
||||||
protected static final long LOCK_TIMEOUT = 5000L;
|
protected static final long DEFAULT_LOCK_TIMEOUT = 5000L;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user