blitz_thread.c suspendSigHandler bb_sem_wait issue

BlitzMax Forums/BlitzMax Programming/blitz_thread.c suspendSigHandler bb_sem_wait issue

ima747(Posted 2010) [#1]
Judging by the crash logs from my tests and from my tester, my multithreaded program is crashing at bb_sem_wait() in suspendSigHandler in blitz_thread.c. This line is tagged with a comment "//wait for resume - apparently very naughty!" so I'm guessing there's a known issue with this, and I'm wondering what it is, or if there are any workarounds...

Basically the main thread kicks the bb_sem_wait and then a child thread will spin out of control in what looks like an infinite recursion and crash. On my system it tends to happen in some memory cleanup code, however on my tester's system it's happening in some graphics rendering code. My suspicion is it's being triggered by the garbage collector since the timing is way off on both systems and not totally reliable. Sometimes the program will run for a couple hours no problem, and other times it will die very shortly after starting up.

Anyone know anything more about this, or any ideas what can be done to prevent the lockup?