Delete 'Locked.cs'
This commit is contained in:
parent
264293f968
commit
dfeedc9702
1 changed files with 0 additions and 89 deletions
89
Locked.cs
89
Locked.cs
|
@ -1,89 +0,0 @@
|
|||
using System;
|
||||
namespace PingPong.Generic
|
||||
{
|
||||
|
||||
public class Locked<T>
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// The lock object.
|
||||
/// </summary>
|
||||
private object lockObject;
|
||||
/// <summary>
|
||||
/// The value.
|
||||
/// </summary>
|
||||
private T value;
|
||||
/// <summary>
|
||||
/// The is locked.
|
||||
/// </summary>
|
||||
private bool isLocked;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The value.
|
||||
/// </value>
|
||||
public T Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (this.lockObject)
|
||||
{
|
||||
this.isLocked = true;
|
||||
this.value = value;
|
||||
this.isLocked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is locked.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// <c>true</c> if this instance is locked; otherwise, <c>false</c>.
|
||||
/// </value>
|
||||
public bool IsLocked
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isLocked;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PingPong.Generic.Locked`1"/> class.
|
||||
/// </summary>
|
||||
public Locked()
|
||||
{
|
||||
this.value = default(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PingPong.Generic.Locked`1"/> class.
|
||||
/// </summary>
|
||||
/// <param name='value'>
|
||||
/// Value.
|
||||
/// </param>
|
||||
public Locked(T value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue