From 29c5fb1804a9b150019db55c3eb7fe536ddfb20f Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Thu, 10 Apr 2014 11:23:31 +0200 Subject: [PATCH] testChannelAccess/testServer: more stable shutdown --- testApp/remote/testADCSim.cpp | 2 +- testApp/remote/testChannelAccess.cpp | 5 +++-- testApp/remote/testServer.cpp | 13 +++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/testApp/remote/testADCSim.cpp b/testApp/remote/testADCSim.cpp index 07ec006..4357815 100644 --- a/testApp/remote/testADCSim.cpp +++ b/testApp/remote/testADCSim.cpp @@ -318,7 +318,7 @@ void SimADC::run() cycle(); } - printf("SimADC shutdown\n"); + //printf("SimADC shutdown\n"); } SimADC::smart_pointer_type createSimADC(const std::string& name) diff --git a/testApp/remote/testChannelAccess.cpp b/testApp/remote/testChannelAccess.cpp index 0f1021d..d5d9aa8 100755 --- a/testApp/remote/testChannelAccess.cpp +++ b/testApp/remote/testChannelAccess.cpp @@ -77,8 +77,9 @@ class ChannelAccessIFRemoteTest: public ChannelAccessIFTest { ~ChannelAccessIFRemoteTest() { m_serverContextAction.stop(); ClientFactory::stop(); - structureChangedListeners.clear(); - structureStore.clear(); + + // shutdown SIGSEG problems + epicsThreadSleep(2.0); } private: diff --git a/testApp/remote/testServer.cpp b/testApp/remote/testServer.cpp index 1f9fb87..0902c98 100644 --- a/testApp/remote/testServer.cpp +++ b/testApp/remote/testServer.cpp @@ -2617,9 +2617,16 @@ void testServer(int timeToRun) unregisterChannelProviderFactory(factory); structureChangedListeners.clear(); - structureStore.clear(); - + { + Lock guard(structureStoreMutex); + structureStore.clear(); + } ctx.reset(); + + unregisterChannelProviderFactory(factory); + + + shutdownSimADCs(); } void testServerShutdown() @@ -2690,8 +2697,6 @@ int main(int argc, char *argv[]) testServer(timeToRun); - shutdownSimADCs(); - cout << "Done" << endl; if (cleanupAndReport)