void HostReflectionHost::BootUp::_run() { report(" Host reflection worker thread started."); while(true) { if(_kill) { if(!areAnyCudaKernelsRunning()) { if(_launches.empty() && !_handleMessage()) { break; } } } if(!_launches.empty()) { _launchNextKernel(); } else if(!_handleMessage()) { boost::this_thread::sleep(boost::posix_time::milliseconds(20)); } else { while(_handleMessage()); } } report(" Host reflection worker thread joined."); }
void MavlinkComm::receive() { //_board->debug->printf_P(PSTR("receive\n")); // if number of channels exceeded return // if (_channel == MAVLINK_COMM_3) return; // receive new packets mavlink_message_t msg; mavlink_status_t status; status.packet_rx_drop_count = 0; // process received bytes while (comm_get_available(_channel)) { uint8_t c = comm_receive_ch(_channel); // Try to get a new message if (mavlink_parse_char(_channel, c, &msg, &status)) _handleMessage(&msg); } // Update packet drops counter _packetDrops += status.packet_rx_drop_count; }
void ServerWorker::_receiveMessage() { const MessageHeader mh = _receiveMessageHeader(); const QByteArray messageByteArray = _receiveMessageBody( mh.size ); _handleMessage( mh, messageByteArray ); }