Skip to content

Commit

Permalink
set State as atomic operation
Browse files Browse the repository at this point in the history
  • Loading branch information
TransposonY committed Jul 22, 2017
1 parent b5a4381 commit f922c7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GestureSign.Daemon/Input/PointCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class PointCapture : ILoadable, IPointCapture, IDisposable
static readonly PointCapture _Instance = new PointCapture();

private CaptureMode _mode = CaptureMode.Normal;
private int _state;

delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime);

Expand Down Expand Up @@ -87,7 +88,11 @@ public List<Point>[] InputPoints
}
}

public CaptureState State { get; set; }
public CaptureState State
{
get { return (CaptureState)_state; }
set { Interlocked.Exchange(ref _state, (int)value); }
}

public CaptureMode Mode
{
Expand Down

0 comments on commit f922c7b

Please sign in to comment.