more threading fixes

This commit is contained in:
David Rose 2006-01-16 00:05:34 +00:00
parent 1123896fc6
commit 92b907eb07
4 changed files with 14 additions and 5 deletions

View File

@ -1219,9 +1219,10 @@ do_add_window(GraphicsOutput *window, GraphicsStateGuardian *gsg,
// now, we assume this is the app thread.
_app.add_window(_app._window, window);
// This was info(), but that is spammy now with the ParisiteBuffer.
display_cat.debug()
<< "Created " << window->get_type() << " " << (void *)window << "\n";
if (display_cat.is_debug()) {
display_cat.debug()
<< "Created " << window->get_type() << " " << (void *)window << "\n";
}
// By default, try to open each window as it is added.
window->request_open();
@ -1755,7 +1756,6 @@ void GraphicsEngine::RenderThread::
thread_main() {
MutexHolder holder(_cv_mutex);
while (true) {
_cv.wait();
switch (_thread_state) {
case TS_wait:
break;
@ -1780,7 +1780,6 @@ thread_main() {
case TS_do_windows:
do_windows(_engine);
do_pending(_engine);
do_release(_engine);
_thread_state = TS_wait;
break;
@ -1789,5 +1788,6 @@ thread_main() {
do_close(_engine);
return;
}
_cv.wait();
}
}

View File

@ -1259,6 +1259,7 @@ make_current() {
void GraphicsOutput::
release_gsg() {
_gsg.clear();
_active = false;
}
////////////////////////////////////////////////////////////////////

View File

@ -42,6 +42,10 @@ public:
register_type(_type_handle, "MainThread",
Thread::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;

View File

@ -83,6 +83,10 @@ public:
register_type(_type_handle, "Thread",
TypedReferenceCount::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;