X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fthreadproj.cpp;h=64216562ab82c04d1c5ec401ee30471db3067313;hp=c4fa9aeabdbad87ae5b86a1c03bc09b4f90abd7c;hb=52f2fdc3424cd6b5b77ad1497243e1e06739ffe6;hpb=eb33bec27b609785c97a8cece532f2348989d308 diff --git a/src/threadproj.cpp b/src/threadproj.cpp index c4fa9ae..6421656 100644 --- a/src/threadproj.cpp +++ b/src/threadproj.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadproj.cpp,v 1.6 2001/03/01 07:30:49 kevin Exp $ +** $Id: threadproj.cpp,v 1.7 2001/03/02 21:11:50 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -31,6 +31,10 @@ #include "wx/wx.h" #endif +#if defined(HAVE_CONFIG_H) +#include "config.h" +#endif + #include "ct.h" #include "ctsim.h" #include "docs.h" @@ -39,9 +43,8 @@ #include "backgroundmgr.h" #include "backgroundsupr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS + @@ -150,16 +153,15 @@ ProjectorSupervisor::onDone() wxCriticalSection doneSection; wxCriticalSectionLocker critsect (doneSection); + Projections* pProjections = getProjections(); + + wxMutexGuiEnter(); ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc(); if (! pProjDoc) { sys_error (ERR_SEVERE, "Unable to create projection file"); return; - } - - Projections* pProjections = getProjections(); + } pProjDoc->setProjections (pProjections); - if (theApp->getAskDeleteNewDocs()) - pProjDoc->Modify (true); pProjDoc->UpdateAllViews (NULL); if (ProjectionFileView* projView = pProjDoc->getView()) { projView->OnUpdate (projView, NULL); @@ -167,6 +169,10 @@ ProjectorSupervisor::onDone() projView->getFrame()->Show(true); } *theApp->getLog() << m_pszLabel << "\n"; + wxMutexGuiLeave(); + + if (theApp->getAskDeleteNewDocs()) + pProjDoc->Modify (true); pProjections->setRemark (m_pszLabel); pProjections->setCalcTime (getTimerEnd()); @@ -274,3 +280,5 @@ void ProjectorWorker::OnExit () { } + +#endif // HAVE_WXTHREADS