25 lines
387 B
C#
25 lines
387 B
C#
|
namespace TimelapseApi;
|
||
|
///<summary>
|
||
|
///an empty object to use lock() { } with
|
||
|
///</summary>
|
||
|
public class LockObj
|
||
|
{
|
||
|
private LockObj()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
public static LockObj Create()
|
||
|
{
|
||
|
return new LockObj();
|
||
|
}
|
||
|
public void Lock(Action a)
|
||
|
{
|
||
|
if(a ==null)
|
||
|
return;
|
||
|
lock(this)
|
||
|
{
|
||
|
|
||
|
a();
|
||
|
}
|
||
|
}
|
||
|
}
|