r581: no message
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 25 Feb 2001 08:43:03 +0000 (08:43 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 25 Feb 2001 08:43:03 +0000 (08:43 +0000)
msvc/ctsim/ctsim.plg
src/backgroundsupr.cpp
src/backgroundsupr.h
src/threadrecon.cpp

index 249267f57862ed2679f89b4a2e7e4e747036f519..e0371fbeb9959ee3c9ca5b30f89c5e1d564be0a0 100644 (file)
@@ -6,13 +6,25 @@
 --------------------Configuration: ctsim - Win32 Debug--------------------
 </h3>
 <h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25B.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28E.tmp" with contents
 [
 /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.4\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
+"C:\ctsim\src\backgroundmgr.cpp"
+"C:\ctsim\src\graph3dview.cpp"
+"C:\ctsim\src\threadrecon.cpp"
 "C:\ctsim\src\backgroundsupr.cpp"
 ]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25B.tmp" 
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25C.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28E.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28F.tmp" with contents
+[
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.4\" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
+"C:\ctsim\src\ctsim.cpp"
+"C:\ctsim\src\dialogs.cpp"
+"C:\ctsim\src\docs.cpp"
+"C:\ctsim\src\views.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP28F.tmp" 
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP290.tmp" with contents
 [
 winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" 
 .\Debug\backgroundmgr.obj
@@ -37,10 +49,20 @@ winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..
 \wx2.2.5\lib\zlibd.lib
 \wx2.2.5\lib\tiffd.lib
 ]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP25C.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP290.tmp"
 <h3>Output Window</h3>
 Compiling...
+threadrecon.cpp
+Skipping... (no relevant changes detected)
+backgroundmgr.cpp
+graph3dview.cpp
 backgroundsupr.cpp
+Compiling...
+Skipping... (no relevant changes detected)
+ctsim.cpp
+dialogs.cpp
+docs.cpp
+views.cpp
 Linking...
 
 
index 04af1d6cb858a41681bfa77f1ecd53c184636fd9..da2120db352c8b13c0bb3454f653527de7fdce74 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: backgroundsupr.cpp,v 1.3 2001/02/25 08:00:57 kevin Exp $
+**  $Id: backgroundsupr.cpp,v 1.4 2001/02/25 08:43:03 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
@@ -70,7 +70,7 @@ BackgroundSupervisor::cancelSupervisor (BackgroundSupervisor* pSupervisor)
 BackgroundSupervisor::BackgroundSupervisor (wxFrame* pParentFrame, wxDocument* pDocument, const char* const pszProcessTitle, int iTotalUnits)
     : m_pParentFrame(pParentFrame), m_pDocument(pDocument), m_pDialogProgress(NULL), m_strProcessTitle(pszProcessTitle), 
     m_iTotalUnits(iTotalUnits), m_iNumThreads(0), m_bDone(false), m_bFail(false), m_bCancelled(false), 
-    m_pTimer(NULL), m_bBackgroundTaskAdded(false),
+    m_pTimer(NULL), m_bBackgroundTaskAdded(false), m_bWorkersDeleted(false),
     wxEvtHandler()
 {
   m_iNumThreads = theApp->getNumberCPU();
@@ -84,16 +84,6 @@ BackgroundSupervisor::BackgroundSupervisor (wxFrame* pParentFrame, wxDocument* p
 
 BackgroundSupervisor::~BackgroundSupervisor()
 {
-  for (int i = 0; i < m_iNumThreads; i++) 
-    if (m_vecpThreads[i]) {
-      m_vecpThreads[i]->Delete(); // sends Destroy message to workers
-  }
-
-  while (m_iRunning > 0) {
-    Sleep(50);
-    ProcessPendingEvents();
-  }
-
   if (m_bBackgroundTaskAdded) {
     wxCommandEvent doneEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_REMOVE);
     doneEvent.SetClientData (this);
@@ -110,6 +100,26 @@ BackgroundSupervisor::~BackgroundSupervisor()
   delete m_pDialogProgress;
 }
 
+void
+BackgroundSupervisor::deleteWorkers()
+{
+  wxCriticalSectionLocker lock (m_critsectThreads);
+  if (m_bWorkersDeleted)
+    return;
+
+  for (int i = 0; i < m_iNumThreads; i++) 
+    if (m_vecpThreads[i]) {
+      m_vecpThreads[i]->Delete(); // sends Destroy message to workers
+  }
+
+  while (m_iRunning > 0) {
+    Sleep(50);
+    ProcessPendingEvents();
+  }
+  m_iRunning = 0;
+  m_bWorkersDeleted = true;
+}
+
 bool
 BackgroundSupervisor::start()
 {
@@ -168,6 +178,7 @@ BackgroundSupervisor::OnCancel(wxCommandEvent& event)
 {
   m_bCancelled = true;
   m_bDone = true;
+  deleteWorkers();
 }
 
 void
@@ -214,8 +225,10 @@ BackgroundSupervisor::OnWorkerDone (wxCommandEvent& event)
     wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
   }
 #endif
-  if (m_iRunning <= 0 && ! m_bCancelled)
+  if (m_iRunning <= 0 && ! m_bCancelled) {
+    deleteWorkers();
     onDone();
+  }
 }
 
 void
index 9058c597f6efb1bf8bcbc5d6171e6f2e98683b89..acc5f55b2331a7af0653790537035bf3c1b4abc6 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: backgroundsupr.h,v 1.2 2001/02/25 08:00:57 kevin Exp $
+**  $Id: backgroundsupr.h,v 1.3 2001/02/25 08:43:03 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
@@ -71,6 +71,8 @@ private:
   bool m_bDone;
   Timer* m_pTimer;
   bool m_bBackgroundTaskAdded;
+  bool m_bWorkersDeleted;
+  wxCriticalSection m_critsectThreads;
 
 public:
   enum {
@@ -106,7 +108,8 @@ public:
   virtual void OnCancel(wxCommandEvent& event);
   virtual void OnAckDocumentRemove(wxCommandEvent& event);
 
-  bool anyWorkersRunning() const { return m_iRunning > 0 ? true : false; }
+  void deleteWorkers();
+  bool workersDeleted() const { return m_bWorkersDeleted; }
   bool isDone() const {return m_bDone;}
   void setDone() { m_bDone = true; }
   bool fail() const {return m_bFail;}
index 75861c492f3f6a8adb7cbab7fe5a1e9396e94383..53d1ef45cbfb5e6a17e1803e8b217a416fc43555 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: threadrecon.cpp,v 1.10 2001/02/25 08:00:57 kevin Exp $
+**  $Id: threadrecon.cpp,v 1.11 2001/02/25 08:43:03 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
@@ -84,9 +84,9 @@ ReconstructorSupervisorThread::Entry()
     wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
   }
 
-  while (reconSupervisor.anyWorkersRunning()) {
+  while (! reconSupervisor.workersDeleted()) {
     Sleep(50);
-    reconSupervisor.ProcessPendingEvents ();
+    reconSupervisor.ProcessPendingEvents();
   }
 
   return reinterpret_cast<wxThread::ExitCode>(0);
@@ -127,8 +127,7 @@ ReconstructorSupervisor::~ReconstructorSupervisor()
   for (int i = 0; i < getNumWorkers(); i++) {
       delete m_vecpChildImageFile[i];
       m_vecpChildImageFile[i] = NULL;
-    }    
-
+    }
 }
 
 BackgroundWorkerThread*