void resetExternal() { if (writer!=NULL) { writer->onCompletion(); writer = NULL; } external = NULL; }
void resetExternal() { if (writer!=nullptr) { writer->onCompletion(); writer = nullptr; } external = nullptr; }
bool release() { stateSema.wait(); PortWriter *cback = callback; current = YARP_NULLPTR; callback = YARP_NULLPTR; stateSema.post(); if (cback!=YARP_NULLPTR) { stateSema.wait(); outCt++; stateSema.post(); cback->onCompletion(); } return cback!=YARP_NULLPTR; }
/** * write something to the port */ bool Port::write(PortWriter& writer, PortReader& reader, PortWriter *callback) const { PortCoreAdapter& core = HELPER(implementation); if (core.isInterrupted()) return false; bool result = false; result = core.send(writer,&reader,callback); if (!result) { //YARP_DEBUG(Logger::get(), e.toString() + " <<<< Port::write saw this"); if (callback!=NULL) { callback->onCompletion(); } else { writer.onCompletion(); } // leave result false } return result; }
bool Port::write(const PortWriter& writer, const PortWriter *callback) const { PortCoreAdapter& core = IMPL(); if (core.isInterrupted()) return false; core.alertOnWrite(); bool result = false; //WritableAdapter adapter(writer); result = core.send(writer, nullptr, callback); //writer.onCompletion(); if (!result) { //YARP_DEBUG(Logger::get(), e.toString() + " <<<< Port::write saw this"); if (callback!=nullptr) { callback->onCompletion(); } else { writer.onCompletion(); } // leave result false } return result; }