Permalink
Browse files

BUGFIX 6724 - Dzieki pfusik!

  • Loading branch information...
1 parent 135261d commit 2f187a5cb1b62df2eb3e5f4850c1000a3f018c01 @jkowalski committed Jan 25, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/NLog/LogEventInfo.cs
View
@@ -359,7 +359,10 @@ internal string AddCachedLayoutValue(Layout layout, string value)
this.layoutCache = new Dictionary<Layout, string>();
}
- this.layoutCache[layout] = value;
+ lock (this.layoutCache)
+ {
+ this.layoutCache[layout] = value;
+ }
return value;
}
@@ -371,7 +374,10 @@ internal bool TryGetCachedLayoutValue(Layout layout, out string value)
return false;
}
- return this.layoutCache.TryGetValue(layout, out value);
+ lock (this.layoutCache)
+ {
+ return this.layoutCache.TryGetValue(layout, out value);
+ }
}
private static bool NeedToPreformatMessage(object[] parameters)

0 comments on commit 2f187a5

Please sign in to comment.