Skip to content

Instantly share code, notes, and snippets.

@ThePhD
Created August 19, 2014 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThePhD/401bb4be200b30ef3bc5 to your computer and use it in GitHub Desktop.
Save ThePhD/401bb4be200b30ef3bc5 to your computer and use it in GitHub Desktop.
/// <summary>
/// Gets a value indicating whether or not this
/// </summary>
public bool IsSynchronized
{
get
{
if (Monitor.TryEnter(this.syncobj))
{
Monitor.Exit(this.syncobj);
return true;
}
return false;
}
}
/// <summary>
/// Gets an object used for synchronization.
/// </summary>
public object SyncRoot
{
get
{
return this.syncobj;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment