From 882b0a3144353d824a71d933be2fbba19764dd8d Mon Sep 17 00:00:00 2001 From: prascle Date: Thu, 2 Jun 2005 07:14:50 +0000 Subject: [PATCH] PAL9042, Correction from Jean Rahuel --- src/Container/Container_i.cxx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 2a4257217..0e1403133 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -295,20 +295,32 @@ void ActSigIntHandler() { perror("SALOME_Container main ") ; exit(0) ; } - INFOS(pthread_self() << "SigIntHandler activated") ; + //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers) + // use of streams (and so on) should never be used because : + // streams of C++ are naturally thread-safe and use pthread_mutex_lock ===> + // A stream operation may be interrupted by a signal and if the Handler use stream we + // may have a "Dead-Lock" ===HangUp + //==INFOS is commented + // INFOS(pthread_self() << "SigIntHandler activated") ; } void SetCpuUsed() ; void SigIntHandler(int what , siginfo_t * siginfo , void * toto ) { - MESSAGE(pthread_self() << "SigIntHandler what " << what << endl - << " si_signo " << siginfo->si_signo << endl - << " si_code " << siginfo->si_code << endl - << " si_pid " << siginfo->si_pid) ; + //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers) + // use of streams (and so on) should never be used because : + // streams of C++ are naturally thread-safe and use pthread_mutex_lock ===> + // A stream operation may be interrupted by a signal and if the Handler use stream we + // may have a "Dead-Lock" ===HangUp + //==MESSAGE is commented + // MESSAGE(pthread_self() << "SigIntHandler what " << what << endl + // << " si_signo " << siginfo->si_signo << endl + // << " si_code " << siginfo->si_code << endl + // << " si_pid " << siginfo->si_pid) ; if ( _Sleeping ) { _Sleeping = false ; - MESSAGE("SigIntHandler END sleeping.") ; + // MESSAGE("SigIntHandler END sleeping.") ; return ; } else { @@ -318,13 +330,13 @@ void SigIntHandler(int what , siginfo_t * siginfo , } else { _Sleeping = true ; - MESSAGE("SigIntHandler BEGIN sleeping.") ; + // MESSAGE("SigIntHandler BEGIN sleeping.") ; int count = 0 ; while( _Sleeping ) { sleep( 1 ) ; count += 1 ; } - MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ; + // MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ; } return ; } -- 2.39.2