1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00
Files
Radarr/src/NzbDrone.Core/ProgressMessaging/ProgressMessageContext.cs
T
2019-12-27 20:40:13 -05:00

37 lines
782 B
C#

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;
}
}
}