Upgraded DisposableTimer to wrap the profiler... now we should really just use DisposableTimer for all profiling.

This commit is contained in:
Shannon Deminick
2013-05-13 21:11:03 -10:00
parent b6f52bf782
commit 5890fe1849
10 changed files with 196 additions and 99 deletions

View File

@@ -69,6 +69,12 @@ namespace Umbraco.Core.ObjectResolution
#endregion
/// <summary>
/// Gets or sets a value indicating whether the resolver can resolve objects before resolution is frozen.
/// </summary>
/// <remarks>This is false by default and is used for some special internal resolvers.</remarks>
internal bool CanResolveBeforeFrozen { get; set; }
/// <summary>
/// Gets a value indicating whether the resolved object instance can be null.
/// </summary>
@@ -96,7 +102,10 @@ namespace Umbraco.Core.ObjectResolution
{
get
{
Resolution.EnsureIsFrozen();
// ensure we can
if (CanResolveBeforeFrozen == false)
Resolution.EnsureIsFrozen();
using (new ReadLock(_lock))
{
if (!_canBeNull && _value == null)