Added static class ThreadHelpers

dev_timestamp
Harald Wolff 2019-09-11 09:26:33 +02:00
parent d02a003071
commit 80f950da0b
2 changed files with 17 additions and 0 deletions

View File

@ -96,6 +96,7 @@
<Compile Include="odb\ng\index\Path.cs" />
<Compile Include="odb\ng\index\IndexPath.cs" />
<Compile Include="PathHelper.cs" />
<Compile Include="threads\ThreadHelpers.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="odb\" />

View File

@ -0,0 +1,16 @@
using System;
namespace ln.types.threads
{
public static class ThreadHelpers
{
public static T GetLockedValue<T>(object lockObject,Func<T> getter)
{
lock (lockObject)
{
return getter();
}
}
}
}