Salome HOME
bos #41408 [EDF - 29761] KERNEL_Launcher and KERNEL_Launcher_SWIG failed
[modules/yacs.git] / src / runtime_swig / ThreadLauncher.hxx
1 // Copyright (C) 2024  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #pragma once
21
22 #include "YACSlibEngineExport.hxx"
23 #include "Proc.hxx"
24
25 #include <thread>
26 #include <memory>
27 #include <string>
28
29 namespace YACS
30 {
31   namespace ENGINE
32   {
33     class YACSLIBENGINE_EXPORT ThreadDumpState
34     {
35     public:
36       ThreadDumpState(Proc *proc, int nbSeconds, const std::string& dumpFile, const std::string& lockFile);
37       ~ThreadDumpState();
38       void run();
39       void start();
40       void join();
41     private:
42       std::unique_ptr< std::thread > _my_thread;
43       Proc *_proc;
44       int _nb_seconds = 0;
45       std::string _dump_file;
46       std::string _lock_file;
47     };
48   }
49 }