Еще немного рефакторинга алгоритма распределения в Jira

This commit is contained in:
Danil Kislov
2019-03-20 13:59:33 +03:00
parent 3adab981fe
commit d90d94e8a7
4 changed files with 39 additions and 46 deletions
+5 -3
View File
@@ -1,5 +1,7 @@
using JiraTimeBot.UI;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
@@ -7,19 +9,19 @@ namespace JiraTimeBot
{
static class Program
{
private static Mutex _mutex = new Mutex(true, "{44426B3E-B901-4792-ACEA-1385D79DBAD1}");
private static readonly Mutex Mutex = new Mutex(true, "{44426B3E-B901-4792-ACEA-1385D79DBAD1}");
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
if (_mutex.WaitOne(TimeSpan.Zero, true))
if (Mutex.WaitOne(TimeSpan.Zero, true))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
_mutex.ReleaseMutex();
Mutex.ReleaseMutex();
}
else
{