Hi everyone,
I am looking into a hang that occurred on the system of one of my colleagues and I was hoping anyone might be able to help me out.
Unfortunately I haven't been able to reproduce it on my own system, but looking at the forced "crash" dump, I see the following:
* we are using the
DrawThreadPerContext threading model
* the software hangs in
ViewerBase::stopThreading in a
setGraphicsThread(0) call
* it hangs there because a graphics thread hangs at
osgViewer::Renderer::draw at
_drawQueue.takeFront()*
Renderer::_drawQueue._isReleased is
false, while
Renderer::_availableQueue._isReleased is
true and
Renderer::_done is
true (so
Renderer::release has been called in
ViewerBase::stopThreading)
The only thing I could find in the code that might produce this last situation is that
Renderer::ThreadSafeQueue::takeFront sets
Renderer::ThreadSafeQueue:: _isReleased to
false again in certain situations.
In
ViewerBase::stopThreading, I see that first all cameras are released, however, if the graphics thread is able to run it's operations multiple times before
stopThreading attempts to kill the thread (
setGraphicsThread(0)), it might be that
Renderer::draw is executed again, causing the hang.
Could it be that this is caused by Renderer::ThreadSafeQueue::takeFront setting _isReleased to false and is it really necessary to set _isReleased to false there ?
If so, could a check for _done at the beginning of Renderer::draw perhaps be a better option ?
I just want to be sure, as changes here might be dangerous, so I am hoping that anyone who is familiar with the code could help me out.
Thanks in advance.
Cheers,
Ben