* remove redundant sync locking in AssetServerBase since this is already being done by the lower database layers

0.6.0-stable
Justin Clarke Casey 2008-07-07 19:32:21 +00:00
parent 1813946937
commit 7fa00f9ecd
5 changed files with 8 additions and 26 deletions

View File

@ -360,7 +360,7 @@ namespace OpenSim.Framework.Communications.Cache
if (!asset.Temporary) if (!asset.Temporary)
{ {
m_assetServer.StoreAndCommitAsset(asset); m_assetServer.StoreAsset(asset);
} }
} }
} }
@ -376,7 +376,7 @@ namespace OpenSim.Framework.Communications.Cache
if (!asset.Temporary) if (!asset.Temporary)
{ {
m_assetServer.StoreAndCommitAsset(asset); m_assetServer.StoreAsset(asset);
} }
} }
} }

View File

@ -44,12 +44,11 @@ namespace OpenSim.Framework.Communications.Cache
protected BlockingQueue<AssetRequest> m_assetRequests; protected BlockingQueue<AssetRequest> m_assetRequests;
protected Thread m_localAssetServerThread; protected Thread m_localAssetServerThread;
protected IAssetProvider m_assetProvider; protected IAssetProvider m_assetProvider;
protected object m_syncLock = new object();
// Temporarily hardcoded - should be a plugin // Temporarily hardcoded - should be a plugin
protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
protected abstract void StoreAsset(AssetBase asset); public abstract void StoreAsset(AssetBase asset);
/// <summary> /// <summary>
/// This method must be implemented by a subclass to retrieve the asset named in the /// 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) public virtual void UpdateAsset(AssetBase asset)
{ {
lock (m_syncLock) m_assetProvider.UpdateAsset(asset);
{
m_assetProvider.UpdateAsset(asset);
}
}
public void StoreAndCommitAsset(AssetBase asset)
{
lock (m_syncLock)
{
StoreAsset(asset);
}
} }
public virtual void Close() public virtual void Close()

View File

@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Cache
throw new Exception("The method or operation is not implemented."); throw new Exception("The method or operation is not implemented.");
} }
protected override void StoreAsset(AssetBase asset) public override void StoreAsset(AssetBase asset)
{ {
try try
{ {

View File

@ -78,16 +78,10 @@ namespace OpenSim.Framework.Communications.Cache
protected override AssetBase GetAsset(AssetRequest req) protected override AssetBase GetAsset(AssetRequest req)
{ {
AssetBase asset; return m_assetProvider.FetchAsset(req.AssetID);;
lock (m_syncLock)
{
asset = m_assetProvider.FetchAsset(req.AssetID);
}
return asset;
} }
protected override void StoreAsset(AssetBase asset) public override void StoreAsset(AssetBase asset)
{ {
m_assetProvider.CreateAsset(asset); m_assetProvider.CreateAsset(asset);
} }

View File

@ -36,8 +36,8 @@ namespace OpenSim.Framework
{ {
void SetReceiver(IAssetReceiver receiver); void SetReceiver(IAssetReceiver receiver);
void RequestAsset(LLUUID assetID, bool isTexture); void RequestAsset(LLUUID assetID, bool isTexture);
void StoreAsset(AssetBase asset);
void UpdateAsset(AssetBase asset); void UpdateAsset(AssetBase asset);
void StoreAndCommitAsset(AssetBase asset);
void Close(); void Close();
} }