diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 4541d1ca68..af3c13c313 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -1593,7 +1593,7 @@ do_add_gsg(GraphicsStateGuardian *gsg, GraphicsPipe *pipe, const GraphicsThreadingModel &threading_model) { MutexHolder holder(_lock); - gsg->_threading_model = get_threading_model(); + gsg->_threading_model = threading_model; gsg->_pipe = pipe; gsg->_engine = this; diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index d0f516b4dc..65ebbbafca 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/panda/src/glxdisplay/glxGraphicsPipe.cxx @@ -22,7 +22,6 @@ #include "glxGraphicsStateGuardian.h" #include "config_glxdisplay.h" #include "frameBufferProperties.h" -#include "mutexHolder.h" TypeHandle glxGraphicsPipe::_type_handle; @@ -30,7 +29,7 @@ bool glxGraphicsPipe::_error_handlers_installed = false; glxGraphicsPipe::ErrorHandlerFunc *glxGraphicsPipe::_prev_error_handler; glxGraphicsPipe::IOErrorHandlerFunc *glxGraphicsPipe::_prev_io_error_handler; -Mutex glxGraphicsPipe::_x_mutex; +ReMutex glxGraphicsPipe::_x_mutex; //////////////////////////////////////////////////////////////////// // Function: glxGraphicsPipe::Constructor diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index 55a610e534..349548d381 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/panda/src/glxdisplay/glxGraphicsPipe.h @@ -24,6 +24,7 @@ #include "graphicsPipe.h" #include "glgsg.h" #include "pmutex.h" +#include "reMutex.h" class FrameBufferProperties; @@ -144,7 +145,7 @@ private: public: // This Mutex protects any X library calls, which all have to be // single-threaded. In particular, it protects glXMakeCurrent(). - static Mutex _x_mutex; + static ReMutex _x_mutex; public: static TypeHandle get_class_type() { diff --git a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx index 3b24418c80..54fd4eef32 100644 --- a/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx +++ b/panda/src/glxdisplay/glxGraphicsStateGuardian.cxx @@ -19,6 +19,7 @@ #include "glxGraphicsStateGuardian.h" #include "config_glxdisplay.h" #include "config_glgsg.h" +#include "reMutexHolder.h" #include @@ -391,7 +392,7 @@ glx_is_at_least_version(int major_version, int minor_version) const { void glxGraphicsStateGuardian:: gl_flush() const { // This call requires synchronization with X. - MutexHolder holder(glxGraphicsPipe::_x_mutex); + ReMutexHolder holder(glxGraphicsPipe::_x_mutex); GLGraphicsStateGuardian::gl_flush(); } @@ -403,7 +404,7 @@ gl_flush() const { GLenum glxGraphicsStateGuardian:: gl_get_error() const { // This call requires synchronization with X. - MutexHolder holder(glxGraphicsPipe::_x_mutex); + ReMutexHolder holder(glxGraphicsPipe::_x_mutex); return GLGraphicsStateGuardian::gl_get_error(); } diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 76bcbc21da..283a0476a6 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -29,6 +29,7 @@ #include "pStatTimer.h" #include "textEncoder.h" #include "throw_event.h" +#include "reMutexHolder.h" #include #include @@ -132,7 +133,7 @@ begin_frame(FrameMode mode, Thread *current_thread) { glxGraphicsStateGuardian *glxgsg; DCAST_INTO_R(glxgsg, _gsg, false); { - MutexHolder holder(glxGraphicsPipe::_x_mutex); + ReMutexHolder holder(glxGraphicsPipe::_x_mutex); glXMakeCurrent(_display, _xwindow, glxgsg->_context); } @@ -203,7 +204,7 @@ begin_flip() { //make_current(); - MutexHolder holder(glxGraphicsPipe::_x_mutex); + ReMutexHolder holder(glxGraphicsPipe::_x_mutex); glXSwapBuffers(_display, _xwindow); } } @@ -220,7 +221,7 @@ begin_flip() { //////////////////////////////////////////////////////////////////// void glxGraphicsWindow:: process_events() { - MutexHolder holder(glxGraphicsPipe::_x_mutex); + ReMutexHolder holder(glxGraphicsPipe::_x_mutex); GraphicsWindow::process_events();