Commit 01b4d19c authored by Pavel Vainerman's avatar Pavel Vainerman

minor fixes (add uniset_spin_lock)

parent b26d06b3
...@@ -256,9 +256,12 @@ IOController_i::ShortMapSeq* UniExchange::getSensors() ...@@ -256,9 +256,12 @@ IOController_i::ShortMapSeq* UniExchange::getSensors()
for( SList::iterator it=mymap.begin(); it!=mymap.end(); ++it ) for( SList::iterator it=mymap.begin(); it!=mymap.end(); ++it )
{ {
IOController_i::ShortMap m; IOController_i::ShortMap m;
{
uniset_spin_lock lock(it->val_lock,30);
m.id = it->id; m.id = it->id;
m.value = it->val; m.value = it->val;
m.type = it->type; m.type = it->type;
}
(*res)[i++] = m; (*res)[i++] = m;
} }
...@@ -271,6 +274,7 @@ void UniExchange::updateLocalData() ...@@ -271,6 +274,7 @@ void UniExchange::updateLocalData()
{ {
try try
{ {
uniset_spin_lock lock(it->val_lock,30);
if( it->type == UniversalIO::DigitalInput || if( it->type == UniversalIO::DigitalInput ||
it->type == UniversalIO::DigitalOutput ) it->type == UniversalIO::DigitalOutput )
{ {
......
...@@ -56,6 +56,7 @@ class UniExchange: ...@@ -56,6 +56,7 @@ class UniExchange:
long val; long val;
long id; long id;
UniversalIO::IOTypes type; UniversalIO::IOTypes type;
UniSetTypes::uniset_spin_mutex val_lock;
}; };
typedef std::vector<SInfo> SList; typedef std::vector<SInfo> SList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment