Salome HOME
merge from branch BR_V5_DEV
[modules/yacs.git] / src / Basics / BasicsGenericDestructor.cxx
index 91585a2ae1d1a92b4162e9f6b4c195575bfcde75..65464f6643929a1abd45ca0555f96b7c58cbddc8 100644 (file)
@@ -1,31 +1,30 @@
-//  SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
 //  File   : BasicGenericDestructor.cxx
 //  Author : Antoine YESSAYAN, Paul RASCLE, EDF
 //  Module : SALOME
 //  $Header$
-
+//
 #include <iostream>
 #include <list>
 #include <cstdlib>
@@ -37,7 +36,12 @@ using namespace std;
 void HouseKeeping();
 
 std::list<PROTECTED_DELETE*> PROTECTED_DELETE::_objList;
+#ifndef WIN32
 pthread_mutex_t PROTECTED_DELETE::_listMutex;
+#else
+pthread_mutex_t PROTECTED_DELETE::_listMutex =
+  PTHREAD_MUTEX_INITIALIZER;
+#endif
 
 std::list<GENERIC_DESTRUCTOR*> *GENERIC_DESTRUCTOR::Destructors = 0;
 static bool atExitSingletonDone = false ;
@@ -167,6 +171,7 @@ void HouseKeeping( void )
 
   delete GENERIC_DESTRUCTOR::Destructors;
   GENERIC_DESTRUCTOR::Destructors = 0;
+  atExitSingletonDone = false ;
   DEVTRACE("HouseKeeping() very end ");
   return ;
 }