From 0326ab7d449d55550edb0f15c56fca029526a45f Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Fri, 18 Apr 2008 15:45:29 +0000 Subject: [PATCH] loosen synchronization around parameter setting - to reduce contention git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@649579 13f79535-47bb-0310-9956-ffa450edef68 --- .../cursors/StoreDurableSubscriberCursor.java | 12 ++++++------ .../region/cursors/StoreQueueCursor.java | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java index 205abe4187..8a8add64ab 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java @@ -251,7 +251,7 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor { return pendingCount; } - public synchronized void setMaxBatchSize(int maxBatchSize) { + public void setMaxBatchSize(int maxBatchSize) { for (Iterator i = storePrefetches.iterator(); i.hasNext();) { AbstractPendingMessageCursor tsp = (AbstractPendingMessageCursor)i.next(); tsp.setMaxBatchSize(maxBatchSize); @@ -266,7 +266,7 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor { } } - public synchronized void setSystemUsage(SystemUsage usageManager) { + public void setSystemUsage(SystemUsage usageManager) { super.setSystemUsage(usageManager); for (Iterator i = storePrefetches.iterator(); i.hasNext();) { PendingMessageCursor tsp = i.next(); @@ -274,28 +274,28 @@ public class StoreDurableSubscriberCursor extends AbstractPendingMessageCursor { } } - public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { + public void setMaxProducersToAudit(int maxProducersToAudit) { super.setMaxProducersToAudit(maxProducersToAudit); for (PendingMessageCursor cursor : storePrefetches) { cursor.setMaxAuditDepth(maxAuditDepth); } } - public synchronized void setMaxAuditDepth(int maxAuditDepth) { + public void setMaxAuditDepth(int maxAuditDepth) { super.setMaxAuditDepth(maxAuditDepth); for (PendingMessageCursor cursor : storePrefetches) { cursor.setMaxAuditDepth(maxAuditDepth); } } - public synchronized void setEnableAudit(boolean enableAudit) { + public void setEnableAudit(boolean enableAudit) { super.setEnableAudit(enableAudit); for (PendingMessageCursor cursor : storePrefetches) { cursor.setEnableAudit(enableAudit); } } - public synchronized void setUseCache(boolean useCache) { + public void setUseCache(boolean useCache) { super.setUseCache(useCache); for (PendingMessageCursor cursor : storePrefetches) { cursor.setUseCache(useCache); diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java index 66204bb50e..fcbbdcbd7a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java @@ -179,25 +179,25 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { * @see org.apache.activemq.region.cursors.PendingMessageCursor * @return true if recovery required */ - public synchronized boolean isRecoveryRequired() { + public boolean isRecoveryRequired() { return false; } /** * @return the nonPersistent Cursor */ - public synchronized PendingMessageCursor getNonPersistent() { + public PendingMessageCursor getNonPersistent() { return this.nonPersistent; } /** * @param nonPersistent cursor to set */ - public synchronized void setNonPersistent(PendingMessageCursor nonPersistent) { + public void setNonPersistent(PendingMessageCursor nonPersistent) { this.nonPersistent = nonPersistent; } - public synchronized void setMaxBatchSize(int maxBatchSize) { + public void setMaxBatchSize(int maxBatchSize) { persistent.setMaxBatchSize(maxBatchSize); if (nonPersistent != null) { nonPersistent.setMaxBatchSize(maxBatchSize); @@ -206,7 +206,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { } - public synchronized void setMaxProducersToAudit(int maxProducersToAudit) { + public void setMaxProducersToAudit(int maxProducersToAudit) { super.setMaxProducersToAudit(maxProducersToAudit); if (persistent != null) { persistent.setMaxProducersToAudit(maxProducersToAudit); @@ -216,7 +216,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { } } - public synchronized void setMaxAuditDepth(int maxAuditDepth) { + public void setMaxAuditDepth(int maxAuditDepth) { super.setMaxAuditDepth(maxAuditDepth); if (persistent != null) { persistent.setMaxAuditDepth(maxAuditDepth); @@ -226,7 +226,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { } } - public synchronized void setEnableAudit(boolean enableAudit) { + public void setEnableAudit(boolean enableAudit) { super.setEnableAudit(enableAudit); if (persistent != null) { persistent.setEnableAudit(enableAudit); @@ -236,7 +236,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { } } - public synchronized void setUseCache(boolean useCache) { + public void setUseCache(boolean useCache) { super.setUseCache(useCache); if (persistent != null) { persistent.setUseCache(useCache); @@ -257,7 +257,7 @@ public class StoreQueueCursor extends AbstractPendingMessageCursor { } } - public synchronized void setSystemUsage(SystemUsage usageManager) { + public void setSystemUsage(SystemUsage usageManager) { super.setSystemUsage(usageManager); if (persistent != null) { persistent.setSystemUsage(usageManager);