Added static class ThreadHelpers
parent
d02a003071
commit
80f950da0b
|
@ -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\" />
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue