Using a SemaphoreSlim instead of locking (which was erroneously implemented, locking once on this and once on this.serviceTable).
Using a SemaphoreSlim prevents the following exception:
System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
at void System.Threading.Monitor.Exit(object obj)
at IEnumerator ArkaneSystems.Arkane.Zeroconf.Providers.Bonjour.ServiceBrowser.GetEnumerator()
Also, the this.serviceTable.ContainsKey() check are not necessary.
Using a SemaphoreSlim instead of locking (which was erroneously implemented, locking once on
this
and once onthis.serviceTable
).Using a SemaphoreSlim prevents the following exception:
Also, the
this.serviceTable.ContainsKey()
check are not necessary.