Commit 717febcb authored by Pavel Vainerman's avatar Pavel Vainerman

(UniSetActivator): Переделал механизм завершения процессов (чтобы не было "SIGSEGV").

Попытка сделать завершение на основе стандартных потоков c++11 (ModbusMaster): сделал возможность задать timeout для теста, правки тестов для более устойчивой работы.
parent e12b4c58
...@@ -54,7 +54,7 @@ int main(int argc, char* argv[] ) ...@@ -54,7 +54,7 @@ int main(int argc, char* argv[] )
act->broadcast( sm.transport_msg() ); act->broadcast( sm.transport_msg() );
act->run(true); act->run(true);
int tout = 6000; int tout = conf->getArgPInt("--timeout",8000);
PassiveTimer pt(tout); PassiveTimer pt(tout);
while( !pt.checkTime() && !act->exist() ) while( !pt.checkTime() && !act->exist() )
msleep(100); msleep(100);
......
/home/pv/Projects.com/uniset-2.0/extensions/SharedMemory/uniset2-smemory
\ No newline at end of file
...@@ -66,10 +66,7 @@ class UniSetActivator: ...@@ -66,10 +66,7 @@ class UniSetActivator:
virtual void run(bool thread); virtual void run(bool thread);
virtual void stop(); virtual void stop();
virtual void oaDestroy(int signo=0); virtual void uaDestroy(int signo=0);
void waitDestroy();
// inline void oakill(int signo){ raise(signo); }
virtual UniSetTypes::ObjectType getType() override { return UniSetTypes::ObjectType("UniSetActivator"); } virtual UniSetTypes::ObjectType getType() override { return UniSetTypes::ObjectType("UniSetActivator"); }
...@@ -114,8 +111,11 @@ class UniSetActivator: ...@@ -114,8 +111,11 @@ class UniSetActivator:
private: private:
friend void terminate_thread();
friend void finished_thread();
static void terminated(int signo); static void terminated(int signo);
static void finishterm(int signo); // static void finishterm(int signo);
static void normalexit(); static void normalexit();
static void normalterminate(); static void normalterminate();
static void set_signals(bool ask); static void set_signals(bool ask);
......
...@@ -53,13 +53,13 @@ TEST_CASE("CallbackTimer", "[CallbackTimer]" ) ...@@ -53,13 +53,13 @@ TEST_CASE("CallbackTimer", "[CallbackTimer]" )
REQUIRE( tc.getNum3() == 0 ); REQUIRE( tc.getNum3() == 0 );
msleep(210); msleep(210);
REQUIRE( tc.getNum1() >= 7 ); REQUIRE( tc.getNum1() >= 5 );
REQUIRE( tc.getNum2() >= 2 ); REQUIRE( tc.getNum2() >= 2 );
REQUIRE( tc.getNum3() == 1 ); REQUIRE( tc.getNum3() == 1 );
tmr.remove(1); tmr.remove(1);
msleep(60); msleep(60);
REQUIRE( tc.getNum1() >= 7 ); REQUIRE( tc.getNum1() >= 6 );
tmr.terminate(); tmr.terminate();
REQUIRE( tc.getNum2() >= 2 ); REQUIRE( tc.getNum2() >= 2 );
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
{ {
bash bash
Memcheck:Leak Memcheck:Leak
match-leak-kinds: definite # match-leak-kinds: definite
fun:malloc fun:malloc
fun:xmalloc fun:xmalloc
fun:make_if_command fun:make_if_command
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment