implement suggestions from Andrew

This commit is contained in:
mrkraimer
2018-02-15 15:57:00 -05:00
parent 952c482d68
commit 5b32b4e072
2 changed files with 6 additions and 2 deletions

View File

@@ -169,7 +169,11 @@ void CAChannelProvider::poll()
void CAChannelProvider::attachContext()
{
if(ca_current_context()) return;
ca_client_context* thread_context = ca_current_context();
if (thread_context == current_context) return;
if (thread_context != NULL) {
throw std::runtime_error("CAChannelProvider: Foreign CA context in use");
}
int result = ca_attach_context(current_context);
if (result != ECA_NORMAL) {
std::cout <<

View File

@@ -73,7 +73,7 @@ public:
void attachContext();
private:
virtual void destroy() EPICS_DEPRECATED {};
virtual void destroy() EPICS_DEPRECATED {}
void initialize();
ca_client_context* current_context;
epics::pvData::Mutex channelListMutex;