From f9a872b2c1934eeebfbee5486de66d147a97a6c5 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 21 Nov 2007 14:22:38 +0000 Subject: [PATCH] make the lock on mesgh drawing local, so that we can draw a mesh during parsing --- Graphics/Mesh.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Graphics/Mesh.cpp b/Graphics/Mesh.cpp index f45ace2abf..6267265950 100644 --- a/Graphics/Mesh.cpp +++ b/Graphics/Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Mesh.cpp,v 1.209 2007-10-02 20:07:29 geuzaine Exp $ +// $Id: Mesh.cpp,v 1.210 2007-11-21 14:22:38 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -832,8 +832,9 @@ void Draw_Mesh() else glDisable((GLenum)(GL_CLIP_PLANE0 + i)); - if(!CTX.threads_lock){ - CTX.threads_lock = 1; + static bool busy = false; + if(!busy){ + busy = true; GModel *m = GModel::current(); int status = m->getMeshStatus(); if(CTX.mesh.changed) { @@ -859,7 +860,7 @@ void Draw_Mesh() if(status >= 3) std::for_each(m->firstRegion(), m->lastRegion(), drawMeshGRegion()); CTX.mesh.changed = 0; - CTX.threads_lock = 0; + busy = false; } for(int i = 0; i < 6; i++) -- GitLab