Commit 8e06f9dc authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1028: Synchronized block scope should be minimal.

To reduce the chance of lock contention, locks should only be put
in effect when the code accesses data that is sensitive to concurrent
access.
parent 3b5e22bb
......@@ -134,9 +134,9 @@ public class StreamManager {
*/
public void processClientAcknowledgement(Element ack) {
if(isEnabled()) {
synchronized (this) {
if (ack.attribute("h") != null) {
long count = Long.valueOf(ack.attributeValue("h"));
if (ack.attribute("h") != null) {
long count = Long.valueOf(ack.attributeValue("h"));
synchronized (this) {
// Remove stanzas from temporary storage as now acknowledged
Log.debug("Ack: h={} mine={} length={}", count, clientProcessedStanzas, unacknowledgedServerStanzas.size());
if (count < clientProcessedStanzas) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment