Comment 4 for bug 1211993

I have attached a refreshed patch against OSG trunk (rev 13788). It compiles and is visually accurate, but is otherwise untested.

Even if this patch is incorporated upstream, I would prefer if the original patch were applied to the version of OSG that is discributed with 12.04 LTS, as my project is tracking the LTS releases and I would rather not keep around my marginally-modified version of OSG.

As a new concern, however, fixing this multithreaded initialization bug has unmasked another: that the library that the OSG Inventor plugin adapts (libcoin60/source package coin3) is not built (at least on 12.04) with the configuration option "--enable-threadsafe". Without that option, the OSG usage pattern in the Inventor plugin triggers another static-global-initialization problem inside libcoin, so I still occasionally race and segfault on the first batch load anyway... yeesh...

Rebuilding libcoin60 with that extra configuration flag enabled seems to relieve the problem without appreciable performance penalty, but I don't know if it is appropriate to ask the LTS maintainers to just go changing config options in a package like that. I know that there have previously been "-mt" variants of such packages, but no such beast seems to exist for libcoin.