Semaphore.Signal on Main Thread will block all processing

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.

Thanks. Offhand that does sound like a bug.

FYI, CriticalSection does the same thing.

Another FYI: This works as I’d expect it to in 2016r11.

<https://xojo.com/issue/44622>