diff options
author | Justin Clarke Casey | 2008-07-07 19:32:21 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-07 19:32:21 +0000 |
commit | 7fa00f9ecdf2ec5d42ebaf411a619e54404e4800 (patch) | |
tree | 4df20e35365c1e73dde417ae01111e03a0fa5644 | |
parent | * remove unused CommitAssets() hook for now (diff) | |
download | opensim-SC_OLD-7fa00f9ecdf2ec5d42ebaf411a619e54404e4800.zip opensim-SC_OLD-7fa00f9ecdf2ec5d42ebaf411a619e54404e4800.tar.gz opensim-SC_OLD-7fa00f9ecdf2ec5d42ebaf411a619e54404e4800.tar.bz2 opensim-SC_OLD-7fa00f9ecdf2ec5d42ebaf411a619e54404e4800.tar.xz |
* remove redundant sync locking in AssetServerBase since this is already being done by the lower database layers
Diffstat (limited to '')
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 | |||
360 | 360 | ||
361 | if (!asset.Temporary) | 361 | if (!asset.Temporary) |
362 | { | 362 | { |
363 | m_assetServer.StoreAndCommitAsset(asset); | 363 | m_assetServer.StoreAsset(asset); |
364 | } | 364 | } |
365 | } | 365 | } |
366 | } | 366 | } |
@@ -376,7 +376,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
376 | 376 | ||
377 | if (!asset.Temporary) | 377 | if (!asset.Temporary) |
378 | { | 378 | { |
379 | m_assetServer.StoreAndCommitAsset(asset); | 379 | m_assetServer.StoreAsset(asset); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | } | 382 | } |
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 | |||
44 | protected BlockingQueue<AssetRequest> m_assetRequests; | 44 | protected BlockingQueue<AssetRequest> m_assetRequests; |
45 | protected Thread m_localAssetServerThread; | 45 | protected Thread m_localAssetServerThread; |
46 | protected IAssetProvider m_assetProvider; | 46 | protected IAssetProvider m_assetProvider; |
47 | protected object m_syncLock = new object(); | ||
48 | 47 | ||
49 | // Temporarily hardcoded - should be a plugin | 48 | // Temporarily hardcoded - should be a plugin |
50 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); | 49 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); |
51 | 50 | ||
52 | protected abstract void StoreAsset(AssetBase asset); | 51 | public abstract void StoreAsset(AssetBase asset); |
53 | 52 | ||
54 | /// <summary> | 53 | /// <summary> |
55 | /// This method must be implemented by a subclass to retrieve the asset named in the | 54 | /// This method must be implemented by a subclass to retrieve the asset named in the |
@@ -161,18 +160,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
161 | 160 | ||
162 | public virtual void UpdateAsset(AssetBase asset) | 161 | public virtual void UpdateAsset(AssetBase asset) |
163 | { | 162 | { |
164 | lock (m_syncLock) | 163 | m_assetProvider.UpdateAsset(asset); |
165 | { | ||
166 | m_assetProvider.UpdateAsset(asset); | ||
167 | } | ||
168 | } | ||
169 | |||
170 | public void StoreAndCommitAsset(AssetBase asset) | ||
171 | { | ||
172 | lock (m_syncLock) | ||
173 | { | ||
174 | StoreAsset(asset); | ||
175 | } | ||
176 | } | 164 | } |
177 | 165 | ||
178 | public virtual void Close() | 166 | 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 | |||
78 | throw new Exception("The method or operation is not implemented."); | 78 | throw new Exception("The method or operation is not implemented."); |
79 | } | 79 | } |
80 | 80 | ||
81 | protected override void StoreAsset(AssetBase asset) | 81 | public override void StoreAsset(AssetBase asset) |
82 | { | 82 | { |
83 | try | 83 | try |
84 | { | 84 | { |
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 | |||
78 | 78 | ||
79 | protected override AssetBase GetAsset(AssetRequest req) | 79 | protected override AssetBase GetAsset(AssetRequest req) |
80 | { | 80 | { |
81 | AssetBase asset; | 81 | return m_assetProvider.FetchAsset(req.AssetID);; |
82 | lock (m_syncLock) | ||
83 | { | ||
84 | asset = m_assetProvider.FetchAsset(req.AssetID); | ||
85 | } | ||
86 | |||
87 | return asset; | ||
88 | } | 82 | } |
89 | 83 | ||
90 | protected override void StoreAsset(AssetBase asset) | 84 | public override void StoreAsset(AssetBase asset) |
91 | { | 85 | { |
92 | m_assetProvider.CreateAsset(asset); | 86 | m_assetProvider.CreateAsset(asset); |
93 | } | 87 | } |
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 | |||
36 | { | 36 | { |
37 | void SetReceiver(IAssetReceiver receiver); | 37 | void SetReceiver(IAssetReceiver receiver); |
38 | void RequestAsset(LLUUID assetID, bool isTexture); | 38 | void RequestAsset(LLUUID assetID, bool isTexture); |
39 | void StoreAsset(AssetBase asset); | ||
39 | void UpdateAsset(AssetBase asset); | 40 | void UpdateAsset(AssetBase asset); |
40 | void StoreAndCommitAsset(AssetBase asset); | ||
41 | void Close(); | 41 | void Close(); |
42 | } | 42 | } |
43 | 43 | ||