Skip to content

Commit

Permalink
Merge pull request #4 from filipw/bugfix/double-lock
Browse files Browse the repository at this point in the history
do not obtain the lock twice
  • Loading branch information
filipw committed Apr 14, 2017
2 parents 3a2bee3 + ff93dae commit c576c73
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions AsyncExpiringLazy.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AsyncExpiringLazy.Tests")]
[assembly: AssemblyTrademark("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down
9 changes: 0 additions & 9 deletions AsyncExpiringLazy/AsyncExpiringLazy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,10 @@ public async Task<T> Value()
{
return _value.Result;
}
}
finally
{
_syncLock.Release();
}

await _syncLock.WaitAsync();
try
{
var result = await _valueProvider(_value).ConfigureAwait(false);
_value = result;
return _value.Result;

}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion AsyncExpiringLazy/AsyncExpiringLazy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>A helper library providing async lazy cabailities to expiring objects.</Description>
<TargetFramework>netstandard1.3</TargetFramework>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<Authors>filipw</Authors>
<AssemblyName>AsyncExpiringLazy</AssemblyName>
<PackageId>Strathweb.AsyncExpiringLazy</PackageId>
Expand Down
3 changes: 0 additions & 3 deletions AsyncExpiringLazy/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AsyncExpiringLazy")]
[assembly: AssemblyTrademark("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down

0 comments on commit c576c73

Please sign in to comment.