changes suggested by Michael Davidsaver

This commit is contained in:
mrkraimer
2017-06-04 14:52:53 -04:00
parent acd9ab42cc
commit b37baf8ecb
7 changed files with 15 additions and 47 deletions
+4 -4
View File
@@ -233,8 +233,8 @@ public:
static Mutex startStopMutex;
ChannelProviderRegistry::shared_pointer CAClientFactory::channelRegistry = ChannelProviderRegistry::shared_pointer();
CAChannelProviderFactoryPtr CAClientFactory::channelProvider = CAChannelProviderFactory::shared_pointer();
ChannelProviderRegistry::shared_pointer CAClientFactory::channelRegistry;
ChannelProviderFactory::shared_pointer CAClientFactory::channelProvider;
int CAClientFactory::numStart = 0;
@@ -249,7 +249,7 @@ std::cout << "CAClientFactory::start() numStart " << numStart << std::endl;
channelProvider.reset(new CAChannelProviderFactory());
channelRegistry = ChannelProviderRegistry::getChannelProviderRegistry();
std::cout << "channelRegistry::use_count " << channelRegistry.use_count() << std::endl;
channelRegistry->registerChannelProviderFactory(channelProvider);
channelRegistry->add(channelProvider);
}
void CAClientFactory::stop()
@@ -262,7 +262,7 @@ std::cout << "channelRegistry::use_count " << channelRegistry.use_count() << std
if(numStart>=1) return;
if (channelProvider)
{
channelRegistry->unregisterChannelProviderFactory(channelProvider);
channelRegistry->remove(CAChannelProvider::PROVIDER_NAME);
if(!channelProvider.unique()) {
LOG(logLevelWarn, "ClientFactory::stop() finds shared client context with %u remaining users",
(unsigned)channelProvider.use_count());
+1 -3
View File
@@ -82,13 +82,11 @@ private:
bool destroyed;
};
class CAChannelProviderFactory;
typedef std::tr1::shared_ptr<CAChannelProviderFactory> CAChannelProviderFactoryPtr;
class epicsShareClass CAClientFactory {
private:
static epics::pvAccess::ChannelProviderRegistry::shared_pointer channelRegistry;
static CAChannelProviderFactoryPtr channelProvider;
static epics::pvAccess::ChannelProviderFactory::shared_pointer channelProvider;
static int numStart;
public:
static void start();