From 7ed6f1315f7f4f0d8f987f52ee7a0bb0f46257e9 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sun, 23 Sep 2018 12:03:45 -0700 Subject: [PATCH] SharedPV::open() less work under lock --- src/server/sharedstate_pv.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/sharedstate_pv.cpp b/src/server/sharedstate_pv.cpp index 17f45f0..4860b23 100644 --- a/src/server/sharedstate_pv.cpp +++ b/src/server/sharedstate_pv.cpp @@ -129,6 +129,8 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet& typedef std::vector > xgetfields_t; const pvd::StructureConstPtr newtype(value.getStructure()); + pvd::PVStructurePtr newvalue(pvd::getPVDataCreate()->createPVStructure(newtype)); + newvalue->copyUnchecked(value, valid); xputs_t p_put; xrpcs_t p_rpc; @@ -145,9 +147,8 @@ void SharedPV::open(const pvd::PVStructure &value, const epics::pvData::BitSet& p_monitor.reserve(monitors.size()); p_getfield.reserve(getfields.size()); - type = value.getStructure(); - current = pvd::getPVDataCreate()->createPVStructure(newtype); - current->copyUnchecked(value); + type = newtype; + current = newvalue; this->valid = valid; FOR_EACH(puts_t::const_iterator, it, end, puts) {