From dec6ad2933f75d4ac475a5e1c4302fe758c60d6d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 May 2012 22:57:33 +0100 Subject: Don't try and update the access time of a file that is actively being cached. This may cause IOErrors on Windows. Aims to help with http://opensimulator.org/mantis/view.php?id=6003 --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 389fb7b..a25976d 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -261,10 +261,14 @@ namespace Flotsam.RegionModules.AssetCache try { - // If the file is already cached, don't cache it, just touch it so access time is updated + // If the file is already cached just update access time. if (File.Exists(filename)) { - File.SetLastAccessTime(filename, DateTime.Now); + lock (m_CurrentlyWriting) + { + if (!m_CurrentlyWriting.Contains(filename)) + File.SetLastAccessTime(filename, DateTime.Now); + } } else { -- cgit v1.1