waitSemaphore returns without prior postSemaphore

BlitzMax Forums/BlitzMax Programming/waitSemaphore returns without prior postSemaphore

Rozek(Posted 2010) [#1]
Hello!

There seems to be another problem with multi-threading: while debugging my (multi-threaded) application, I realized, that - from time to time - "waitSemaphore" returned although there was no associated call to "postSemaphore" before!

Again, it's difficult to find out under which circumstances this happens, but it seems, as if continuous mouse events (in the main thread) sooner or later also trigger "waitSemaphore" in the subthread.

Does anybody have similar experiences?


Rozek(Posted 2010) [#2]
[deleted and posted as a separate thread - sorry]


Rozek(Posted 2010) [#3]
This problem still occurs in BMX 1.39 - it's annoying because it requires

- an additional flag which indicates whether the semaphore was really incremented an
- a "while" loop which checks if "waitSemaphore" erroneously terminated