X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fthreadraster.cpp;h=252d6c592e9026d3bf98d8b6a2a3dbf5d2c7ce94;hp=00f89dc103c670901ba203ac60c9b97965407f1a;hb=52f2fdc3424cd6b5b77ad1497243e1e06739ffe6;hpb=eb33bec27b609785c97a8cece532f2348989d308 diff --git a/src/threadraster.cpp b/src/threadraster.cpp index 00f89dc..252d6c5 100644 --- a/src/threadraster.cpp +++ b/src/threadraster.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadraster.cpp,v 1.1 2001/02/27 03:59:30 kevin Exp $ +** $Id: threadraster.cpp,v 1.2 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 @@ -25,6 +25,11 @@ ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ******************************************************************************/ + +#if defined(HAVE_CONFIG_H) +#include "config.h" +#endif + #include "wx/wxprec.h" #ifndef WX_PRECOMP @@ -35,15 +40,15 @@ #include "ctsim.h" #include "docs.h" #include "views.h" + + +#ifdef HAVE_WXTHREADS + + #include "threadraster.h" #include "backgroundmgr.h" #include "backgroundsupr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif - - ///////////////////////////////////////////////////////////////////// // @@ -135,16 +140,15 @@ RasterizerSupervisor::onDone() wxCriticalSection doneSection; wxCriticalSectionLocker critsect (doneSection); + ImageFile* pImageFile = getImageFile(); + + wxMutexGuiEnter(); ImageFileDocument* pImageDoc = theApp->newImageDoc(); if (! pImageDoc) { sys_error (ERR_SEVERE, "Unable to create image file"); return; - } - - ImageFile* pImageFile = getImageFile(); + } pImageDoc->setImageFile (pImageFile); - if (theApp->getAskDeleteNewDocs()) - pImageDoc->Modify (true); pImageDoc->UpdateAllViews (NULL); if (ImageFileView* imageView = pImageDoc->getView()) { imageView->OnUpdate (imageView, NULL); @@ -152,7 +156,10 @@ RasterizerSupervisor::onDone() imageView->getFrame()->Show(true); } *theApp->getLog() << m_pszLabel << "\n"; + wxMutexGuiLeave(); pImageFile->labelAdd (m_pszLabel, getTimerEnd()); + if (theApp->getAskDeleteNewDocs()) + pImageDoc->Modify (true); setDone(); } @@ -230,3 +237,5 @@ void RasterizerWorker::OnExit () { } + +#endif // HAVE_WXTHREADS