File tree 2 files changed +8
-1
lines changed
libraries/YarpPlugins/TechnosoftIpos
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ bool TechnosoftIposBase::open(yarp::os::Searchable & config)
130
130
}
131
131
}
132
132
133
- return !monitorThread || monitorThread-> start () ;
133
+ return true ;
134
134
}
135
135
136
136
// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -124,6 +124,13 @@ bool TechnosoftIposBase::initialize()
124
124
yCIWarning (IPOS, id ()) << " Initial drive state transitions failed" ;
125
125
}
126
126
127
+ // the monitor thread itself may call `initialize()`, so we need to check to avoid starting twice
128
+ if (monitorThread && !monitorThread->isRunning () && !monitorThread->start ())
129
+ {
130
+ yCIError (IPOS, id ()) << " Unable to start monitor thread" ;
131
+ return false ;
132
+ }
133
+
127
134
return true ;
128
135
}
129
136
You can’t perform that action at this time.
0 commit comments