)
ADD_LIBRARY(YACSRuntimePython ThreadLauncher.cxx)
+TARGET_LINK_LIBRARIES(YACSRuntimePython YACSRuntimeSALOME ${PYTHON_LIBRARIES} )
INSTALL(TARGETS YACSRuntimePython EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
# libraries to link to
}
%}
+%{
+#include "Proc.hxx"
+
+#include <thread>
+#include <memory>
+#include <string>
+using namespace YACS::ENGINE;
+class ThreadDumpState
+{
+ public:
+ ThreadDumpState(Proc *proc, int nbSeconds, const std::string& dumpFile, const std::string& lockFile);
+ ~ThreadDumpState();
+ void start();
+ void join();
+};
+%}
+
// ----------------------------------------------------------------------------
#ifdef SWIGPYTHON
}
}
-namespace YACS
-{
- namespace ENGINE
- {
- class YACSLIBENGINE_EXPORT ThreadDumpState
- {
- public:
- ThreadDumpState(Proc *proc, int nbSeconds, const std::string& dumpFile, const std::string& lockFile);
- ~ThreadDumpState();
- void start();
- void join();
- };
- }
-}
{
#ifdef WIN32
Sleep(_nb_seconds);
+ std::string cmd = "COPY /b " + _lock_file + " +,,";
#else
sleep(_nb_seconds);
-#endif
std::string cmd = "touch " + _lock_file;
+#endif
system(cmd.c_str());
schemaSaveStateUnsafe(_proc,_dump_file);
+#ifdef WIN32
+ cmd = "DEL /Q /F " + _lock_file;
+#else
cmd = "rm -f " + _lock_file;
+#endif
system(cmd.c_str());
state = _proc->getEffectiveState();
}