Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Fix event listener creation on GpioPin (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Mar 7, 2019
1 parent 344e23f commit 24322d5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/Windows.Devices.Gpio/GpioPin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ public sealed class Gpio​Pin : IGpioPin, IDisposable
{
_pinNumber = pinNumber;

s_eventListener = new GpioPinEventListener();
_syncLock = new object();

lock (_syncLock)
{
if (s_eventListener == null)
{
s_eventListener = new GpioPinEventListener();
}
}
}

internal bool Init()
Expand Down

0 comments on commit 24322d5

Please sign in to comment.