Consider this scenario
Thread1 calls aSemaphore.Signal and continues processing. Later it will call Release. But while it’s processing, the Main Thread calls aSemaphore.Signal, halting processing. I’d expect that Thread1 would be given time to finish its processing so it can release the Semaphore and allow the Main Thread to continue, but that’s not what’s happening. All processing, everywhere, stops. Forever.
The workaround is to use code like this instead to give the Thread the time it needs.
while not aSemaphore.TrySignal
wend
I’ll get Feedback posted soon.