| 115 | } |
| 116 | |
| 117 | void RelayThreadMonitor::on_data_available(DDS::DataReader_ptr /*reader*/) |
| 118 | { |
| 119 | ACE_GUARD(ACE_Thread_Mutex, g, mutex_); |
| 120 | |
| 121 | OpenDDS::DCPS::InternalThreadBuiltinTopicDataSeq datas; |
| 122 | DDS::SampleInfoSeq infos; |
| 123 | const DDS::ReturnCode_t ret = thread_status_reader_->read(datas, |
| 124 | infos, |
| 125 | DDS::LENGTH_UNLIMITED, |
| 126 | DDS::NOT_READ_SAMPLE_STATE, |
| 127 | DDS::ANY_VIEW_STATE, |
| 128 | DDS::ANY_INSTANCE_STATE); |
| 129 | |
| 130 | if (ret == DDS::RETCODE_NO_DATA) { |
| 131 | return; |
| 132 | } |
| 133 | |
| 134 | if (ret != DDS::RETCODE_OK) { |
| 135 | ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: RelayThreadMonitor::on_data_available failed to read %C\n", OpenDDS::DCPS::retcode_to_string(ret))); |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | for (CORBA::ULong idx = 0; idx != infos.length(); ++idx) { |
| 140 | if (infos[idx].valid_data) { |
| 141 | utilization_[datas[idx].thread_id.in()] = datas[idx].utilization; |
| 142 | } else if (infos[idx].instance_state != DDS::ALIVE_INSTANCE_STATE) { |
| 143 | utilization_.erase(datas[idx].thread_id.in()); |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | std::string RelayThreadMonitor::decompose_thread_detail1(int detail) const |
| 149 | { |
nothing calls this directly
no test coverage detected