[osg-users] OpenThreads threading bug on creation/deletion (leads to crashes)
acoates at stanford.edu
Mon Sep 24 12:40:17 PDT 2007
It looks like there's still a problem with the current setup. The
Thread object itself can get deleted before the pthread actually gets
to the lock (which, I guess is what you just added). While it looks
like this doesn't cause a crash, the problem is evidenced by valgrind
(reports uninitalized memory reads/writes to the lock -- which got
freed by the Thread destructor).
You seem like you're pretty busy, so if you want, I can take a crack
at this -- I think the Thread code is simple enough, but I'll need to
think a bit to figure out how to get around this. One (simple)
solution is to just join() the thread from the ~Thread() destructor.
More information about the osg-users