From 7fa00f9ecdf2ec5d42ebaf411a619e54404e4800 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 7 Jul 2008 19:32:21 +0000 Subject: * remove redundant sync locking in AssetServerBase since this is already being done by the lower database layers --- OpenSim/Framework/Communications/Cache/AssetCache.cs | 4 ++-- .../Framework/Communications/Cache/AssetServerBase.cs | 16 ++-------------- .../Framework/Communications/Cache/GridAssetClient.cs | 2 +- OpenSim/Framework/Communications/Cache/SQLAssetServer.cs | 10 ++-------- OpenSim/Framework/IAssetServer.cs | 2 +- 5 files changed, 8 insertions(+), 26 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 7099760..d0bcc98 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -360,7 +360,7 @@ namespace OpenSim.Framework.Communications.Cache if (!asset.Temporary) { - m_assetServer.StoreAndCommitAsset(asset); + m_assetServer.StoreAsset(asset); } } } @@ -376,7 +376,7 @@ namespace OpenSim.Framework.Communications.Cache if (!asset.Temporary) { - m_assetServer.StoreAndCommitAsset(asset); + m_assetServer.StoreAsset(asset); } } } diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index f65b88f..f729d78 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -44,12 +44,11 @@ namespace OpenSim.Framework.Communications.Cache protected BlockingQueue m_assetRequests; protected Thread m_localAssetServerThread; protected IAssetProvider m_assetProvider; - protected object m_syncLock = new object(); // Temporarily hardcoded - should be a plugin protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); - protected abstract void StoreAsset(AssetBase asset); + public abstract void StoreAsset(AssetBase asset); /// /// This method must be implemented by a subclass to retrieve the asset named in the @@ -161,18 +160,7 @@ namespace OpenSim.Framework.Communications.Cache public virtual void UpdateAsset(AssetBase asset) { - lock (m_syncLock) - { - m_assetProvider.UpdateAsset(asset); - } - } - - public void StoreAndCommitAsset(AssetBase asset) - { - lock (m_syncLock) - { - StoreAsset(asset); - } + m_assetProvider.UpdateAsset(asset); } public virtual void Close() diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 6caabcd..4206cae 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Cache throw new Exception("The method or operation is not implemented."); } - protected override void StoreAsset(AssetBase asset) + public override void StoreAsset(AssetBase asset) { try { diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 95696ee..94a8509 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs @@ -78,16 +78,10 @@ namespace OpenSim.Framework.Communications.Cache protected override AssetBase GetAsset(AssetRequest req) { - AssetBase asset; - lock (m_syncLock) - { - asset = m_assetProvider.FetchAsset(req.AssetID); - } - - return asset; + return m_assetProvider.FetchAsset(req.AssetID);; } - protected override void StoreAsset(AssetBase asset) + public override void StoreAsset(AssetBase asset) { m_assetProvider.CreateAsset(asset); } diff --git a/OpenSim/Framework/IAssetServer.cs b/OpenSim/Framework/IAssetServer.cs index 0e89348..f96bdc6 100644 --- a/OpenSim/Framework/IAssetServer.cs +++ b/OpenSim/Framework/IAssetServer.cs @@ -36,8 +36,8 @@ namespace OpenSim.Framework { void SetReceiver(IAssetReceiver receiver); void RequestAsset(LLUUID assetID, bool isTexture); + void StoreAsset(AssetBase asset); void UpdateAsset(AssetBase asset); - void StoreAndCommitAsset(AssetBase asset); void Close(); } -- cgit v1.1