You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs

35 lines
762 B

using System;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.ProgressMessaging
{
public static class ProgressMessageContext
{
[ThreadStatic]
private static CommandModel _commandModel;
[ThreadStatic]
private static bool _reentrancyLock;
public static CommandModel CommandModel
{
get { return _commandModel; }
set { _commandModel = value; }
}
public static bool LockReentrancy()
{
if (_reentrancyLock)
return false;
_reentrancyLock = true;
return true;
}
public static void UnlockReentrancy()
{
_reentrancyLock = false;
}
}
}