changes suggested by Michael Davidsaver
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user