while ((!_threadToClose) || myTraceBuffer->toCollect() )
{
- //if (_threadToClose)
- // cerr << "FileTraceCollector _threadToClose" << endl << flush;
+ if (_threadToClose)
+ cerr << "FileTraceCollector _threadToClose" << endl << flush;
int fullBuf = myTraceBuffer->retrieve(myTrace);
if (myTrace.traceType == ABORT_MESS)
#endif
}
}
- //cerr <<"traceFile.close();" << endl << flush;
+ cerr <<"traceFile.close();" << endl << flush;
traceFile.close();
+ cerr <<"traceFile.close()_end;" << endl << flush;
+ pthread_exit(NULL);
}
- pthread_exit(NULL);
- return NULL;
+ //return NULL;
}
// ============================================================================
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton)
{
- //cerr << "FileTraceCollector:: ~FileTraceCollector()" << endl << flush;
+ cerr << "FileTraceCollector:: ~FileTraceCollector()" << endl << flush;
LocalTraceBufferPool* myTraceBuffer = LocalTraceBufferPool::instance();
_threadToClose = 1;
myTraceBuffer->insert(NORMAL_MESS,"end of trace\n"); // to wake up thread
{
int ret = pthread_join(*_threadId, NULL);
if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
- //else cerr << "FileTraceCollector destruction OK" << endl;
+ else cerr << "FileTraceCollector destruction OK" << endl;
_threadId = 0;
_threadToClose = 0;
}
while ((!_threadToClose) || myTraceBuffer->toCollect() )
{
int fullBuf = myTraceBuffer->retrieve(myTrace);
- if (myTrace.traceType == ABORT_MESS)
+ if (!CORBA::is_nil(_orb))
{
- stringstream abortMessage("");
+ if (myTrace.traceType == ABORT_MESS)
+ {
+ stringstream abortMessage("");
#ifndef WNT
- abortMessage << "INTERRUPTION from thread "
- << myTrace.threadId << " : " << myTrace.trace;
+ abortMessage << "INTERRUPTION from thread "
+ << myTrace.threadId << " : " << myTrace.trace;
#else
- abortMessage << "INTERRUPTION from thread "
- << (void*)&myTrace.threadId
- << " : " << myTrace.trace;
+ abortMessage << "INTERRUPTION from thread "
+ << (void*)&myTrace.threadId
+ << " : " << myTrace.trace;
#endif
- CORBA::String_var LogMsg =
- CORBA::string_dup(abortMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
- exit(1);
- }
- else
- {
- stringstream aMessage("");
+ CORBA::String_var LogMsg =
+ CORBA::string_dup(abortMessage.str().c_str());
+ m_pInterfaceLogger->putMessage(LogMsg);
+ exit(1);
+ }
+ else
+ {
+ stringstream aMessage("");
#ifndef WNT
- aMessage << "th. " << myTrace.threadId
+ aMessage << "th. " << myTrace.threadId
#else
- aMessage << "th. " << (void*)&myTrace.threadId
+ aMessage << "th. " << (void*)&myTrace.threadId
#endif
- << " " << myTrace.trace;
- CORBA::String_var LogMsg =
- CORBA::string_dup(aMessage.str().c_str());
- m_pInterfaceLogger->putMessage(LogMsg);
+ << " " << myTrace.trace;
+ CORBA::String_var LogMsg =
+ CORBA::string_dup(aMessage.str().c_str());
+ m_pInterfaceLogger->putMessage(LogMsg);
+ }
}
}
}