diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d436ed6bc8a..685fe3e6675 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -2636,14 +2636,11 @@ jobs: cat "$GITHUB_WORKSPACE/OpenDDS/${{ github.job }}_autobuild_workspace/logs/latest.txt" grep -q 'Failures: 0' "$GITHUB_WORKSPACE/OpenDDS/${{ github.job }}_autobuild_workspace/logs/latest.txt" - ACE_TAO_u22_gcc11_i0_xer0: + ACE_TAO_u22_i0_xer0: runs-on: ubuntu-22.04 steps: - - name: install gcc and g++ - run: | - sudo apt-get install g++-11 - name: checkout OpenDDS uses: actions/checkout@v4 with: @@ -2664,7 +2661,7 @@ jobs: - name: get compiler version shell: bash run: | - export COMPILER_VERSION=$(g++-11 --version 2>&1 | head -n 1) + export COMPILER_VERSION=$(g++ --version 2>&1 | head -n 1) echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV - name: Cache Artifact id: cache-artifact @@ -2682,7 +2679,7 @@ jobs: if: steps.cache-artifact.outputs.cache-hit != 'true' run: | cd OpenDDS - ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING + ./configure --std=c++20 --no-inline --tests --ace=$GITHUB_WORKSPACE/OpenDDS/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: build ACE and TAO if: steps.cache-artifact.outputs.cache-hit != 'true' run: | @@ -2708,16 +2705,13 @@ jobs: name: ${{ github.job }}_artifact path: ${{ github.job }}.tar.xz - build_u22_gcc11_i0_xer0: + build_u22_i0_xer0: runs-on: ubuntu-22.04 - needs: ACE_TAO_u22_gcc11_i0_xer0 + needs: ACE_TAO_u22_i0_xer0 steps: - - name: install gcc and g++ - run: | - sudo apt-get install g++-11 - name: checkout MPC uses: actions/checkout@v4 with: @@ -2732,13 +2726,13 @@ jobs: - name: download ACE_TAO artifact uses: actions/download-artifact@v4 with: - name: ACE_TAO_u22_gcc11_i0_xer0_artifact + name: ACE_TAO_u22_i0_xer0_artifact path: ACE_TAO - name: extract ACE_TAO artifact shell: bash run: | cd ACE_TAO - tar xvfJ ACE_TAO_u22_gcc11_i0_xer0.tar.xz + tar xvfJ ACE_TAO_u22_i0_xer0.tar.xz - name: checkout OpenDDS uses: actions/checkout@v4 with: @@ -2747,7 +2741,7 @@ jobs: - name: configure OpenDDS run: | cd OpenDDS - ./configure --compiler=g++-11 --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING + ./configure --std=c++20 --no-inline --tests --rapidjson --boottime --ace=$GITHUB_WORKSPACE/ACE_TAO/ACE --mpc=$GITHUB_WORKSPACE/MPC --compile-warnings=WARNING - name: check build configuration shell: bash run: | @@ -2766,7 +2760,7 @@ jobs: source OpenDDS/setenv.sh mkdir OpenDDS/tests/cmake/build cd OpenDDS/tests/cmake/build - cmake -DCMAKE_CXX_COMPILER=g++-11 .. + cmake .. cmake --build . -- -j4 - name: create OpenDDS tar.xz artifact shell: bash @@ -2783,11 +2777,11 @@ jobs: name: ${{ github.job }}_artifact path: ${{ github.job }}.tar.xz - cmake_u22_gcc11_i0_xer0: + test_u22_i0_xer0: runs-on: ubuntu-22.04 - needs: build_u22_gcc11_i0_xer0 + needs: build_u22_i0_xer0 permissions: contents: read @@ -2813,13 +2807,13 @@ jobs: - name: download ACE_TAO artifact uses: actions/download-artifact@v4 with: - name: ACE_TAO_u22_gcc11_i0_xer0_artifact + name: ACE_TAO_u22_i0_xer0_artifact path: ACE_TAO - name: extract ACE_TAO artifact shell: bash run: | cd ACE_TAO - tar xvfJ ACE_TAO_u22_gcc11_i0_xer0.tar.xz + tar xvfJ ACE_TAO_u22_i0_xer0.tar.xz - name: checkout OpenDDS uses: actions/checkout@v4 with: @@ -2828,13 +2822,13 @@ jobs: - name: download OpenDDS artifact uses: actions/download-artifact@v4 with: - name: build_u22_gcc11_i0_xer0_artifact + name: build_u22_i0_xer0_artifact path: OpenDDS - name: extract OpenDDS artifact shell: bash run: | cd OpenDDS - tar xvfJ build_u22_gcc11_i0_xer0.tar.xz + tar xvfJ build_u22_i0_xer0.tar.xz - name: check build configuration shell: bash run: | @@ -2881,7 +2875,7 @@ jobs: - + diff --git a/configure b/configure index 1c5a8e08856..04cd667db6e 100755 --- a/configure +++ b/configure @@ -62,7 +62,7 @@ my %platforminfo = 'cl_versions' => {13.1 => 'vc71', 14 => 'vc8', 15 => 'vc9', 16 => 'vc10', 17 => 'vc11', 18 => 'vc12', 19 => 'vc14', 19.1 => 'vs2017', - 19.2 => 'vs2019', 19.3 => 'vs2022'}, + 19.2 => 'vs2019', 19.3 => 'vs2022', 19.4 => 'vs2022'}, 'cl_archs' => {'x64' => 1, 'Win32' => 1, 'ARM64' => 0, 'ARM' => 0}, # 1 if supported }, 'macos' => { diff --git a/dds/DCPS/DataReaderImpl_T.h b/dds/DCPS/DataReaderImpl_T.h index 6b656b7d367..82e58bafcd5 100644 --- a/dds/DCPS/DataReaderImpl_T.h +++ b/dds/DCPS/DataReaderImpl_T.h @@ -850,7 +850,7 @@ namespace OpenDDS { bool filtered = false; SubscriptionInstance_rch instance; - const DDS::Time_t now = timestamp.to_dds_time(); + const DDS::Time_t now = timestamp.to_idl_struct(); DataSampleHeader header; header.source_timestamp_sec_ = now.sec; header.source_timestamp_nanosec_ = now.nanosec; @@ -898,7 +898,7 @@ namespace OpenDDS { SubscriptionInstance_rch si = get_handle_instance(instance); if (si && state != DDS::ALIVE_INSTANCE_STATE) { - const DDS::Time_t now = timestamp.to_dds_time(); + const DDS::Time_t now = timestamp.to_idl_struct(); DataSampleHeader header; header.publication_id_ = publication_id; header.source_timestamp_sec_ = now.sec; diff --git a/dds/DCPS/DataWriterImpl.cpp b/dds/DCPS/DataWriterImpl.cpp index 4624a389fa0..041e0265852 100644 --- a/dds/DCPS/DataWriterImpl.cpp +++ b/dds/DCPS/DataWriterImpl.cpp @@ -543,7 +543,7 @@ DataWriterImpl::association_complete_i(const GUID_t& remote_id) Message_Block_Ptr end_historic_samples( create_control_message( END_HISTORIC_SAMPLES, header, move(data), - SystemTimePoint::now().to_dds_time())); + SystemTimePoint::now().to_idl_struct())); this->controlTracker.message_sent(); guard.release(); @@ -776,7 +776,7 @@ void DataWriterImpl::replay_durable_data_for(const GUID_t& remote_id) DataSampleHeader header; Message_Block_Ptr end_historic_samples(create_control_message(END_HISTORIC_SAMPLES, header, move(data), - SystemTimePoint::now().to_dds_time())); + SystemTimePoint::now().to_idl_struct())); this->controlTracker.message_sent(); guard.release(); @@ -1075,7 +1075,7 @@ DataWriterImpl::send_request_ack() REQUEST_ACK, element->get_header(), move(blk), - SystemTimePoint::now().to_dds_time())); + SystemTimePoint::now().to_idl_struct())); element->set_sample(move(sample)); @@ -2426,7 +2426,7 @@ DataWriterImpl::end_coherent_changes(const GroupCoherentSamples& group_samples) Message_Block_Ptr control( create_control_message( END_COHERENT_CHANGES, header, move(data), - SystemTimePoint::now().to_dds_time())); + SystemTimePoint::now().to_idl_struct())); this->coherent_ = false; this->coherent_samples_ = 0; @@ -2550,7 +2550,7 @@ DataWriterImpl::send_liveliness(const MonotonicTimePoint& now) Message_Block_Ptr liveliness_msg( create_control_message( DATAWRITER_LIVELINESS, header, move(empty), - SystemTimePoint::now().to_dds_time())); + SystemTimePoint::now().to_idl_struct())); if (this->send_control(header, move(liveliness_msg)) == SEND_CONTROL_ERROR) { ACE_ERROR_RETURN((LM_ERROR, @@ -2582,7 +2582,7 @@ DataWriterImpl::prepare_to_delete() #endif // Unregister all registered instances prior to deletion. - unregister_instances(SystemTimePoint::now().to_dds_time()); + unregister_instances(SystemTimePoint::now().to_idl_struct()); const Observer_rch observer = get_observer(Observer::e_DELETED); if (observer) { diff --git a/dds/DCPS/DataWriterImpl_T.h b/dds/DCPS/DataWriterImpl_T.h index 73d1aa7c31c..86b902a8adc 100644 --- a/dds/DCPS/DataWriterImpl_T.h +++ b/dds/DCPS/DataWriterImpl_T.h @@ -52,7 +52,7 @@ DataWriterImpl_T DDS::InstanceHandle_t register_instance(const MessageType& instance) { - return register_instance_w_timestamp(instance, SystemTimePoint::now().to_dds_time()); + return register_instance_w_timestamp(instance, SystemTimePoint::now().to_idl_struct()); } DDS::InstanceHandle_t register_instance_w_timestamp( @@ -64,7 +64,7 @@ DataWriterImpl_T DDS::ReturnCode_t unregister_instance(const MessageType& instance, DDS::InstanceHandle_t handle) { - return unregister_instance_w_timestamp(instance, handle, SystemTimePoint::now().to_dds_time()); + return unregister_instance_w_timestamp(instance, handle, SystemTimePoint::now().to_idl_struct()); } DDS::ReturnCode_t unregister_instance_w_timestamp( @@ -81,7 +81,7 @@ DataWriterImpl_T // This lack of safety helps performance. DDS::ReturnCode_t write(const MessageType& instance_data, DDS::InstanceHandle_t handle) { - return write_w_timestamp(instance_data, handle, SystemTimePoint::now().to_dds_time()); + return write_w_timestamp(instance_data, handle, SystemTimePoint::now().to_idl_struct()); } //WARNING: If the handle is non-nil and the instance is not registered @@ -98,7 +98,7 @@ DataWriterImpl_T DDS::ReturnCode_t dispose(const MessageType& instance_data, DDS::InstanceHandle_t instance_handle) { - return dispose_w_timestamp(instance_data, instance_handle, SystemTimePoint::now().to_dds_time()); + return dispose_w_timestamp(instance_data, instance_handle, SystemTimePoint::now().to_idl_struct()); } DDS::ReturnCode_t dispose_w_timestamp( diff --git a/dds/DCPS/DomainParticipantImpl.cpp b/dds/DCPS/DomainParticipantImpl.cpp index 5719b5b5155..175e82191e7 100644 --- a/dds/DCPS/DomainParticipantImpl.cpp +++ b/dds/DCPS/DomainParticipantImpl.cpp @@ -1518,7 +1518,7 @@ DomainParticipantImpl::get_default_topic_qos( DDS::ReturnCode_t DomainParticipantImpl::get_current_time(DDS::Time_t& current_time) { - current_time = SystemTimePoint::now().to_dds_time(); + current_time = SystemTimePoint::now().to_idl_struct(); return DDS::RETCODE_OK; } diff --git a/dds/DCPS/Hash.cpp b/dds/DCPS/Hash.cpp index fbf4846112e..9aeae185226 100644 --- a/dds/DCPS/Hash.cpp +++ b/dds/DCPS/Hash.cpp @@ -251,7 +251,7 @@ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size) } memcpy(&ctx->buffer[used], data, free); - data = (unsigned char *)data + free; + data = (const unsigned char *)data + free; size -= free; body(ctx, ctx->buffer, 64); } diff --git a/dds/DCPS/InternalDataReader.h b/dds/DCPS/InternalDataReader.h index db078975a32..22db3515d15 100644 --- a/dds/DCPS/InternalDataReader.h +++ b/dds/DCPS/InternalDataReader.h @@ -340,7 +340,7 @@ class InternalDataReader : public InternalEntity { { if (instance_state_ == DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE && !is_infinite(qos.reader_data_lifecycle.autopurge_disposed_samples_delay) && - SystemTimePoint::now().to_dds_time() > disposed_expiration_date_) { + SystemTimePoint::now().to_idl_struct() > disposed_expiration_date_) { not_read_samples_.clear(); read_samples_.clear(); } @@ -357,7 +357,7 @@ class InternalDataReader : public InternalEntity { if (instance_state_ == DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE && !is_infinite(qos.reader_data_lifecycle.autopurge_nowriter_samples_delay) && - SystemTimePoint::now().to_dds_time() > no_writers_expiration_date_) { + SystemTimePoint::now().to_idl_struct() > no_writers_expiration_date_) { return true; } @@ -511,7 +511,7 @@ class InternalDataReader : public InternalEntity { if (instance_state_ == DDS::ALIVE_INSTANCE_STATE) { instance_state_ = DDS::NOT_ALIVE_DISPOSED_INSTANCE_STATE; - disposed_expiration_date_ = SystemTimePoint::now().to_dds_time() + qos.reader_data_lifecycle.autopurge_disposed_samples_delay; + disposed_expiration_date_ = SystemTimePoint::now().to_idl_struct() + qos.reader_data_lifecycle.autopurge_disposed_samples_delay; informed_of_not_alive_ = false; return true; } @@ -526,7 +526,7 @@ class InternalDataReader : public InternalEntity { if (publication_set_.empty() && instance_state_ == DDS::ALIVE_INSTANCE_STATE) { instance_state_ = DDS::NOT_ALIVE_NO_WRITERS_INSTANCE_STATE; - no_writers_expiration_date_ = SystemTimePoint::now().to_dds_time() + qos.reader_data_lifecycle.autopurge_nowriter_samples_delay; + no_writers_expiration_date_ = SystemTimePoint::now().to_idl_struct() + qos.reader_data_lifecycle.autopurge_nowriter_samples_delay; informed_of_not_alive_ = false; return true; } diff --git a/dds/DCPS/Logging.cpp b/dds/DCPS/Logging.cpp index 8cde3732a79..5dd2389e0a9 100644 --- a/dds/DCPS/Logging.cpp +++ b/dds/DCPS/Logging.cpp @@ -25,7 +25,7 @@ void OpenDDS_Dcps_Export log_progress(const char* activity, { ACE_DEBUG((LM_INFO, "(%P|%t) {transport_debug.log_progress} local: %C remote: %C reference: %C time(ms): %Lu activity: %C\n", DCPS::LogGuid(local).c_str(), DCPS::LogGuid(remote).c_str(), DCPS::LogGuid(reference).c_str(), - duration_to_time_value(MonotonicTimePoint::now().to_monotonic_time() - start_time).msec(), + duration_to_time_value(MonotonicTimePoint::now().to_idl_struct() - start_time).msec(), activity)); } diff --git a/dds/DCPS/RTPS/Spdp.cpp b/dds/DCPS/RTPS/Spdp.cpp index aa9b6d3541f..4a3cb6f7f6b 100644 --- a/dds/DCPS/RTPS/Spdp.cpp +++ b/dds/DCPS/RTPS/Spdp.cpp @@ -247,7 +247,7 @@ Spdp::Spdp(DDS::DomainId_t domain, #endif , domain_(domain) , guid_(guid) - , participant_discovered_at_(MonotonicTimePoint::now().to_monotonic_time()) + , participant_discovered_at_(MonotonicTimePoint::now().to_idl_struct()) , is_application_participant_(false) , ipv4_participant_port_id_(0) #ifdef ACE_HAS_IPV6 @@ -310,7 +310,7 @@ Spdp::Spdp(DDS::DomainId_t domain, , secure_participant_user_data_(disco->config()->secure_participant_user_data()) , domain_(domain) , guid_(guid) - , participant_discovered_at_(MonotonicTimePoint::now().to_monotonic_time()) + , participant_discovered_at_(MonotonicTimePoint::now().to_idl_struct()) , is_application_participant_(false) , ipv4_participant_port_id_(0) #ifdef ACE_HAS_IPV6 @@ -561,56 +561,56 @@ void Spdp::process_location_updates_i(const DiscoveredParticipantIter& iter, con case DCPS::LOCATION_LOCAL: address_change = addr.compare(location_data.local_addr.in()) != 0; location_data.local_addr = addr.c_str(); - location_data.local_timestamp = pos->timestamp_.to_dds_time(); + location_data.local_timestamp = pos->timestamp_.to_idl_struct(); break; case DCPS::LOCATION_ICE: address_change = addr.compare(location_data.ice_addr.in()) != 0; location_data.ice_addr = addr.c_str(); - location_data.ice_timestamp = pos->timestamp_.to_dds_time(); + location_data.ice_timestamp = pos->timestamp_.to_idl_struct(); break; case DCPS::LOCATION_RELAY: address_change = addr.compare(location_data.relay_addr.in()) != 0; location_data.relay_addr = addr.c_str(); - location_data.relay_timestamp = pos->timestamp_.to_dds_time(); + location_data.relay_timestamp = pos->timestamp_.to_idl_struct(); break; case DCPS::LOCATION_LOCAL6: address_change = addr.compare(location_data.local6_addr.in()) != 0; location_data.local6_addr = addr.c_str(); - location_data.local6_timestamp = pos->timestamp_.to_dds_time(); + location_data.local6_timestamp = pos->timestamp_.to_idl_struct(); break; case DCPS::LOCATION_ICE6: address_change = addr.compare(location_data.ice6_addr.in()) != 0; location_data.ice6_addr = addr.c_str(); - location_data.ice6_timestamp = pos->timestamp_.to_dds_time(); + location_data.ice6_timestamp = pos->timestamp_.to_idl_struct(); break; case DCPS::LOCATION_RELAY6: address_change = addr.compare(location_data.relay6_addr.in()) != 0; location_data.relay6_addr = addr.c_str(); - location_data.relay6_timestamp = pos->timestamp_.to_dds_time(); + location_data.relay6_timestamp = pos->timestamp_.to_idl_struct(); break; } - const DDS::Time_t expr = (pos->timestamp_ - leaseDuration).to_dds_time(); + const DDS::Time_t expr = (pos->timestamp_ - leaseDuration).to_idl_struct(); if ((location_data.location & DCPS::LOCATION_LOCAL) && DCPS::operator<(location_data.local_timestamp, expr)) { location_data.location &= ~(DCPS::LOCATION_LOCAL); location_data.change_mask |= DCPS::LOCATION_LOCAL; - location_data.local_timestamp = pos->timestamp_.to_dds_time(); + location_data.local_timestamp = pos->timestamp_.to_idl_struct(); } if ((location_data.location & DCPS::LOCATION_RELAY) && DCPS::operator<(location_data.relay_timestamp, expr)) { location_data.location &= ~(DCPS::LOCATION_RELAY); location_data.change_mask |= DCPS::LOCATION_RELAY; - location_data.relay_timestamp = pos->timestamp_.to_dds_time(); + location_data.relay_timestamp = pos->timestamp_.to_idl_struct(); } if ((location_data.location & DCPS::LOCATION_LOCAL6) && DCPS::operator<(location_data.local6_timestamp, expr)) { location_data.location &= ~(DCPS::LOCATION_LOCAL6); location_data.change_mask |= DCPS::LOCATION_LOCAL6; - location_data.local6_timestamp = pos->timestamp_.to_dds_time(); + location_data.local6_timestamp = pos->timestamp_.to_idl_struct(); } if ((location_data.location & DCPS::LOCATION_RELAY6) && DCPS::operator<(location_data.relay6_timestamp, expr)) { location_data.location &= ~(DCPS::LOCATION_RELAY6); location_data.change_mask |= DCPS::LOCATION_RELAY6; - location_data.relay6_timestamp = pos->timestamp_.to_dds_time(); + location_data.relay6_timestamp = pos->timestamp_.to_idl_struct(); } if (old_mask != location_data.location || address_change) { @@ -870,7 +870,7 @@ Spdp::handle_participant_data(DCPS::MessageId id, } if (DCPS::transport_debug.log_progress) { - log_progress("participant discovery", guid_, guid, iter->second.discovered_at_.to_monotonic_time()); + log_progress("participant discovery", guid_, guid, iter->second.discovered_at_.to_idl_struct()); } #ifndef DDS_HAS_MINIMUM_BIT @@ -957,7 +957,7 @@ Spdp::handle_participant_data(DCPS::MessageId id, } else { // Existing Participant if (from_sedp && DCPS::transport_debug.log_progress) { - log_progress("secure participant discovery", guid_, guid, iter->second.discovered_at_.to_monotonic_time()); + log_progress("secure participant discovery", guid_, guid, iter->second.discovered_at_.to_idl_struct()); } #ifndef DDS_HAS_MINIMUM_BIT @@ -1096,7 +1096,7 @@ Spdp::data_received(const DataSubmessage& data, ParticipantData_t pdata; pdata.participantProxy.domainId = domain_; - pdata.discoveredAt = now.to_monotonic_time(); + pdata.discoveredAt = now.to_idl_struct(); #if OPENDDS_CONFIG_SECURITY pdata.ddsParticipantDataSecure.base.base.key = DCPS::BUILTIN_TOPIC_KEY_UNKNOWN; #endif @@ -1950,7 +1950,7 @@ Spdp::handle_participant_crypto_tokens(const DDS::Security::ParticipantVolatileM } if (DCPS::transport_debug.log_progress) { - log_progress("participant crypto token", guid_, src_participant, iter->second.discovered_at_.to_monotonic_time()); + log_progress("participant crypto token", guid_, src_participant, iter->second.discovered_at_.to_idl_struct()); } const DDS::Security::ParticipantCryptoTokenSeq& inboundTokens = @@ -2117,7 +2117,7 @@ Spdp::match_authenticated(const DCPS::GUID_t& guid, DiscoveredParticipantIter& i } if (DCPS::transport_debug.log_progress) { - log_progress("authentication", guid_, guid, iter->second.discovered_at_.to_monotonic_time()); + log_progress("authentication", guid_, guid, iter->second.discovered_at_.to_idl_struct()); } DDS::Security::ParticipantCryptoHandle dp_crypto_handle = @@ -4430,6 +4430,7 @@ void Spdp::SpdpTransport::thread_status_task(const DCPS::MonotonicTimePoint& now DCPS::InternalThreadBuiltinTopicData data; data.thread_id = i->bit_key().c_str(); data.utilization = i->utilization(now); + data.monotonic_timestamp = i->last_update().to_idl_struct(); outer->bit_subscriber_->add_thread_status(data, DDS::NEW_VIEW_STATE, i->timestamp()); } @@ -4596,7 +4597,7 @@ DCPS::MonotonicTime_t Spdp::get_participant_discovered_at(const DCPS::GUID_t& gu { const DiscoveredParticipantConstIter iter = participants_.find(make_part_guid(guid)); if (iter != participants_.end()) { - return iter->second.discovered_at_.to_monotonic_time(); + return iter->second.discovered_at_.to_idl_struct(); } return DCPS::MonotonicTime_t(); diff --git a/dds/DCPS/ReactorTask.cpp b/dds/DCPS/ReactorTask.cpp index bc0660576ad..4fd70265ca5 100644 --- a/dds/DCPS/ReactorTask.cpp +++ b/dds/DCPS/ReactorTask.cpp @@ -13,6 +13,7 @@ #endif /* __ACE_INLINE__ */ #include "Service_Participant.h" +#include "Timers.h" #include #include @@ -159,18 +160,29 @@ int ReactorTask::svc() condition_.notify_all(); } - // Tell the reactor to handle events. + Timers::TimerId thread_status_timer = Timers::InvalidTimerId; + RcHandle tsm_updater_handler; + if (thread_status_manager_->update_thread_status()) { - while (state() == STATE_RUNNING) { - ACE_Time_Value t = thread_status_manager_->thread_status_interval().value(); - ThreadStatusManager::Sleeper sleeper(*thread_status_manager_); - reactor_->run_reactor_event_loop(t, 0); + tsm_updater_handler = make_rch(); + const TimeDuration period = thread_status_manager_->thread_status_interval(); + thread_status_timer = Timers::schedule(reactor_, *tsm_updater_handler, thread_status_manager_, + period, period); + + if (thread_status_timer == Timers::InvalidTimerId) { + if (log_level >= LogLevel::Notice) { + ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: ReactorTask::svc: failed to " + "schedule timer for ThreadStatusManager::Updater\n")); + } } - - } else { - reactor_->run_reactor_event_loop(); } + ThreadStatusManager::Sleeper sleeper(thread_status_manager_); + reactor_->run_reactor_event_loop(); + + if (thread_status_timer != Timers::InvalidTimerId) { + Timers::cancel(reactor_, thread_status_timer); + } return 0; } diff --git a/dds/DCPS/ReactorTask.h b/dds/DCPS/ReactorTask.h index 6b1464250dd..aa9a415bb57 100644 --- a/dds/DCPS/ReactorTask.h +++ b/dds/DCPS/ReactorTask.h @@ -111,11 +111,10 @@ class OpenDDS_Dcps_Export ReactorTask : public virtual ACE_Task_Base, #endif TimerQueueType* timer_queue_; + ReactorInterceptor_rch interceptor_; // thread status reporting String name_; - - ReactorInterceptor_rch interceptor_; ThreadStatusManager* thread_status_manager_; }; diff --git a/dds/DCPS/ReceivedDataElementList.h b/dds/DCPS/ReceivedDataElementList.h index b97cf12dea2..c6bedde00fd 100644 --- a/dds/DCPS/ReceivedDataElementList.h +++ b/dds/DCPS/ReceivedDataElementList.h @@ -36,6 +36,7 @@ class OpenDDS_Dcps_Export ReceivedDataElement { : pub_(header.publication_id_), registered_data_(received_data), sample_state_(DDS::NOT_READ_SAMPLE_STATE), + destination_timestamp_(SystemTimePoint::now().to_idl_struct()), #ifndef OPENDDS_NO_OBJECT_MODEL_PROFILE coherent_change_(header.coherent_change_), group_coherent_(header.group_coherent_), @@ -51,8 +52,6 @@ class OpenDDS_Dcps_Export ReceivedDataElement { ref_count_(1), mx_(mx) { - destination_timestamp_ = SystemTimePoint::now().to_dds_time(); - source_timestamp_.sec = header.source_timestamp_sec_; source_timestamp_.nanosec = header.source_timestamp_nanosec_; diff --git a/dds/DCPS/RecorderImpl.cpp b/dds/DCPS/RecorderImpl.cpp index 25f053bbaaa..6cb024d17ff 100644 --- a/dds/DCPS/RecorderImpl.cpp +++ b/dds/DCPS/RecorderImpl.cpp @@ -364,7 +364,7 @@ RecorderImpl::add_association(const WriterAssociation& writer, // // if (where->second->should_ack(now)) { // const SequenceNumber sequence = where->second->ack_sequence(); - // if (send_sample_ack(writer.writerId, sequence, now.to_dds_time())) { + // if (send_sample_ack(writer.writerId, sequence, now.to_idl_struct())) { // where->second->clear_acks(sequence); // } // } diff --git a/dds/DCPS/ReplayerImpl.cpp b/dds/DCPS/ReplayerImpl.cpp index 5fb7f51308f..b035b213968 100644 --- a/dds/DCPS/ReplayerImpl.cpp +++ b/dds/DCPS/ReplayerImpl.cpp @@ -102,7 +102,7 @@ ReplayerImpl::cleanup() { // // Unregister all registered instances prior to deletion. - // // this->unregister_instances(SystemTimePoint::now().to_dds_time()); + // // this->unregister_instances(SystemTimePoint::now().to_idl_struct()); // // // CORBA::String_var topic_name = this->get_Atopic_name(); { diff --git a/dds/DCPS/ThreadStatusManager.h b/dds/DCPS/ThreadStatusManager.h index a848232e4d0..c0c917933d8 100644 --- a/dds/DCPS/ThreadStatusManager.h +++ b/dds/DCPS/ThreadStatusManager.h @@ -9,6 +9,7 @@ #define OPENDDS_DCPS_THREADSTATUSMANAGER_H #include "dcps_export.h" +#include "RcEventHandler.h" #include "TimeTypes.h" OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL @@ -158,6 +159,16 @@ class OpenDDS_Dcps_Export ThreadStatusManager { ThreadStatusManager* const thread_status_manager_; }; + struct Updater : RcEventHandler { + int handle_timeout(const ACE_Time_Value&, const void* arg) + { + const ThreadStatusManager* const tsmConst = static_cast(arg); + ThreadStatusManager* const tsm = const_cast(tsmConst); + tsm->idle(); + return 0; + } + }; + /// Copy active and idle threads to running and finished threads to /// finished. Only threads updated after start are considered. void harvest(const MonotonicTimePoint& start, diff --git a/dds/DCPS/TimePoint_T.cpp b/dds/DCPS/TimePoint_T.cpp index 92ce6621460..77a9689bf99 100644 --- a/dds/DCPS/TimePoint_T.cpp +++ b/dds/DCPS/TimePoint_T.cpp @@ -11,19 +11,19 @@ OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace DCPS { -template -const TimePoint_T TimePoint_T::zero_value(ACE_Time_Value(0, 0)); +template +const TimePoint_T TimePoint_T::zero_value(ACE_Time_Value(0, 0)); #ifdef ACE_HAS_CPP11 -template -const TimePoint_T TimePoint_T::max_value(ACE_Time_Value(std::numeric_limits::max(), ACE_ONE_SECOND_IN_USECS - 1)); +template +const TimePoint_T TimePoint_T::max_value(ACE_Time_Value(std::numeric_limits::max(), ACE_ONE_SECOND_IN_USECS - 1)); #else -template -const TimePoint_T TimePoint_T::max_value(ACE_Time_Value(ACE_Numeric_Limits::max(), ACE_ONE_SECOND_IN_USECS - 1)); +template +const TimePoint_T TimePoint_T::max_value(ACE_Time_Value(ACE_Numeric_Limits::max(), ACE_ONE_SECOND_IN_USECS - 1)); #endif /* ACE_HAS_CPP11 */ -template -AceClock TimePoint_T::clock; +template +AceClock TimePoint_T::clock; } } diff --git a/dds/DCPS/TimePoint_T.h b/dds/DCPS/TimePoint_T.h index 783edc8d132..b508770f917 100644 --- a/dds/DCPS/TimePoint_T.h +++ b/dds/DCPS/TimePoint_T.h @@ -4,8 +4,6 @@ #include "TimeDuration.h" #include "SafeBool_T.h" -#include - #include #if !defined (ACE_LACKS_PRAGMA_ONCE) @@ -31,14 +29,15 @@ namespace DCPS { * (or docs/internal/dev_guidelines.rst) for background and reasoning for this * class. */ -template -class TimePoint_T : public SafeBool_T > { +template +class TimePoint_T : public SafeBool_T > { public: typedef AceClock ClockType; + typedef IdlType IdlStruct; typedef ACE_Time_Value_T ValueType; - const static TimePoint_T zero_value; - const static TimePoint_T max_value; + const static TimePoint_T zero_value; + const static TimePoint_T max_value; /** * Set to zero_value, which is equal to the epoch (the starting point) of the @@ -51,19 +50,18 @@ class TimePoint_T : public SafeBool_T > { * necessary. * * \warning Use these carefully. Make sure ACE_Time_Value is a point in time - * and of the right clock type. DDS::Time_t should be in system clock time - * and so shouldn't be used with MonotonicTimePoint. + * and of the right clock type. */ ///@{ explicit TimePoint_T(const ACE_Time_Value& ace_time_value); - explicit TimePoint_T(const ACE_Time_Value_T& ace_time_value); - explicit TimePoint_T(const DDS::Time_t& dds_time); + explicit TimePoint_T(const ValueType& ace_time_value); + explicit TimePoint_T(const IdlType& from_idl); ///@} /** * Get a TimePoint representing the current time of the AceClock. */ - static TimePoint_T now(); + static TimePoint_T now(); /** * Get and set the inner ACE_Time_Value based value. Use value() to pass this @@ -71,8 +69,8 @@ class TimePoint_T : public SafeBool_T > { * type. */ ///@{ - const ACE_Time_Value_T& value() const; - void value(const ACE_Time_Value_T& ace_time_value); + const ValueType& value() const; + void value(const ValueType& ace_time_value); ///@} /** @@ -96,18 +94,12 @@ class TimePoint_T : public SafeBool_T > { void set_to_now(); /** - * Convert to DDS::Time_t. This is probably only desirable for the system - * time version of this template class, SystemTimePoint. - */ - DDS::Time_t to_dds_time() const; - - /** - * Convert to OpenDDS::DCPS::MonotonicTime_t. + * Convert to the corresponding IDL struct type. */ - MonotonicTime_t to_monotonic_time() const; + IdlType to_idl_struct() const; - TimePoint_T& operator+=(const TimeDuration& td); - TimePoint_T& operator-=(const TimeDuration& td); + TimePoint_T& operator+=(const TimeDuration& td); + TimePoint_T& operator-=(const TimeDuration& td); protected: /** @@ -119,35 +111,35 @@ class TimePoint_T : public SafeBool_T > { ValueType value_; }; -template -TimePoint_T operator+(const TimeDuration& x, const TimePoint_T& y); +template +TimePoint_T operator+(const TimeDuration& x, const TimePoint_T& y); -template -TimePoint_T operator+(const TimePoint_T& x, const TimeDuration& y); +template +TimePoint_T operator+(const TimePoint_T& x, const TimeDuration& y); -template -TimeDuration operator-(const TimePoint_T& x, const TimePoint_T& y); +template +TimeDuration operator-(const TimePoint_T& x, const TimePoint_T& y); -template -TimePoint_T operator-(const TimePoint_T& x, const TimeDuration& y); +template +TimePoint_T operator-(const TimePoint_T& x, const TimeDuration& y); -template -bool operator<(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator<(const TimePoint_T& x, const TimePoint_T& y); -template -bool operator>(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator>(const TimePoint_T& x, const TimePoint_T& y); -template -bool operator<=(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator<=(const TimePoint_T& x, const TimePoint_T& y); -template -bool operator>=(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator>=(const TimePoint_T& x, const TimePoint_T& y); -template -bool operator==(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator==(const TimePoint_T& x, const TimePoint_T& y); -template -bool operator!=(const TimePoint_T& x, const TimePoint_T& y); +template +bool operator!=(const TimePoint_T& x, const TimePoint_T& y); } // namespace DCPS } // namespace OpenDDS diff --git a/dds/DCPS/TimePoint_T.inl b/dds/DCPS/TimePoint_T.inl index 8567f6a0eab..176a9e4cd53 100644 --- a/dds/DCPS/TimePoint_T.inl +++ b/dds/DCPS/TimePoint_T.inl @@ -7,192 +7,186 @@ OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace DCPS { -template +template ACE_INLINE -TimePoint_T::TimePoint_T() +TimePoint_T::TimePoint_T() : value_(zero_value.value()) { } -template +template ACE_INLINE -TimePoint_T::TimePoint_T(const ACE_Time_Value& ace_time_value) +TimePoint_T::TimePoint_T(const ACE_Time_Value& ace_time_value) : value_(ace_time_value) { } -template +template ACE_INLINE -TimePoint_T::TimePoint_T(const ACE_Time_Value_T& ace_time_value) +TimePoint_T::TimePoint_T(const ACE_Time_Value_T& ace_time_value) : value_(ace_time_value) { } -template +template ACE_INLINE -TimePoint_T::TimePoint_T(const DDS::Time_t& dds_time) -: value_(time_to_time_value(dds_time)) +TimePoint_T::TimePoint_T(const IdlType& idl_time) +: value_(time_to_time_value(idl_time)) { } -template +template ACE_INLINE -TimePoint_T -TimePoint_T::now() +TimePoint_T +TimePoint_T::now() { - return TimePoint_T(clock()); + return TimePoint_T(clock()); } -template +template ACE_INLINE const ACE_Time_Value_T& -TimePoint_T::value() const +TimePoint_T::value() const { return value_; } -template +template ACE_INLINE void -TimePoint_T::value(const ACE_Time_Value_T& ace_time_value) +TimePoint_T::value(const ACE_Time_Value_T& ace_time_value) { value_ = ace_time_value; } -template +template ACE_INLINE bool -TimePoint_T::is_zero() const +TimePoint_T::is_zero() const { return *this == zero_value; } -template +template ACE_INLINE bool -TimePoint_T::is_max() const +TimePoint_T::is_max() const { return *this == max_value; } -template +template ACE_INLINE void -TimePoint_T::set_to_now() +TimePoint_T::set_to_now() { value_ = clock(); } -template +template ACE_INLINE -DDS::Time_t -TimePoint_T::to_dds_time() const +IdlType +TimePoint_T::to_idl_struct() const { - return time_value_to_time(value_); + IdlType i; + time_value_to_time(i, value_); + return i; } -template +template ACE_INLINE -MonotonicTime_t -TimePoint_T::to_monotonic_time() const -{ - return time_value_to_monotonic_time(value_); -} - -template -ACE_INLINE -TimePoint_T& -TimePoint_T::operator+=(const TimeDuration& td) +TimePoint_T& +TimePoint_T::operator+=(const TimeDuration& td) { value_ += td.value(); return *this; } -template +template ACE_INLINE -TimePoint_T& -TimePoint_T::operator-=(const TimeDuration& td) +TimePoint_T& +TimePoint_T::operator-=(const TimeDuration& td) { value_ -= td.value(); return *this; } -template +template ACE_INLINE -TimePoint_T -operator+(const TimeDuration& x, const TimePoint_T& y) +TimePoint_T +operator+(const TimeDuration& x, const TimePoint_T& y) { - return TimePoint_T(x.value() + y.value()); + return TimePoint_T(x.value() + y.value()); } -template +template ACE_INLINE -TimePoint_T -operator+(const TimePoint_T& x, const TimeDuration& y) +TimePoint_T +operator+(const TimePoint_T& x, const TimeDuration& y) { - return TimePoint_T(x.value() + y.value()); + return TimePoint_T(x.value() + y.value()); } -template +template ACE_INLINE TimeDuration -operator-(const TimePoint_T& x, const TimePoint_T& y) +operator-(const TimePoint_T& x, const TimePoint_T& y) { return TimeDuration(x.value() - y.value()); } -template +template ACE_INLINE -TimePoint_T -operator-(const TimePoint_T& x, const TimeDuration& y) +TimePoint_T +operator-(const TimePoint_T& x, const TimeDuration& y) { - return TimePoint_T(x.value() - y.value()); + return TimePoint_T(x.value() - y.value()); } -template +template ACE_INLINE bool -operator<(const TimePoint_T& x, const TimePoint_T& y) +operator<(const TimePoint_T& x, const TimePoint_T& y) { return x.value() < y.value(); } -template +template ACE_INLINE bool -operator>(const TimePoint_T& x, const TimePoint_T& y) +operator>(const TimePoint_T& x, const TimePoint_T& y) { return x.value() > y.value(); } -template +template ACE_INLINE bool -operator<=(const TimePoint_T& x, const TimePoint_T& y) +operator<=(const TimePoint_T& x, const TimePoint_T& y) { return x.value() <= y.value(); } -template +template ACE_INLINE bool -operator>=(const TimePoint_T& x, const TimePoint_T& y) +operator>=(const TimePoint_T& x, const TimePoint_T& y) { return x.value() >= y.value(); } -template +template ACE_INLINE bool -operator==(const TimePoint_T& x, const TimePoint_T& y) +operator==(const TimePoint_T& x, const TimePoint_T& y) { return x.value() == y.value(); } -template +template ACE_INLINE bool -operator!=(const TimePoint_T& x, const TimePoint_T& y) +operator!=(const TimePoint_T& x, const TimePoint_T& y) { return x.value() != y.value(); } diff --git a/dds/DCPS/TimeTypes.h b/dds/DCPS/TimeTypes.h index 3b627108317..6404d2fc0f1 100644 --- a/dds/DCPS/TimeTypes.h +++ b/dds/DCPS/TimeTypes.h @@ -11,6 +11,8 @@ #include "TimeDuration.h" #include "TimePoint_T.h" +#include + #include #include @@ -29,7 +31,7 @@ namespace DCPS { */ ///@{ typedef ACE_System_Time_Policy SystemClock; -typedef TimePoint_T SystemTimePoint; +typedef TimePoint_T SystemTimePoint; ///@} /** @@ -48,7 +50,7 @@ typedef ACE_Monotonic_Time_Policy MonotonicClock; #else typedef SystemClock MonotonicClock; #endif -typedef TimePoint_T MonotonicTimePoint; +typedef TimePoint_T MonotonicTimePoint; ///@} } // namespace DCPS diff --git a/dds/DCPS/Time_Helper.h b/dds/DCPS/Time_Helper.h index aa20ab12445..07874ae5434 100644 --- a/dds/DCPS/Time_Helper.h +++ b/dds/DCPS/Time_Helper.h @@ -12,6 +12,7 @@ #include #include +#include #include #ifndef ACE_LACKS_PRAGMA_ONCE @@ -23,14 +24,25 @@ OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL namespace OpenDDS { namespace DCPS { -ACE_INLINE OpenDDS_Dcps_Export -ACE_Time_Value time_to_time_value(const DDS::Time_t& t); +template +ACE_Time_Value time_to_time_value(const TimeT& t) +{ + ACE_Time_Value tv(t.sec, t.nanosec / 1000); + return tv; +} + +template +void time_value_to_time(IdlType& t, const ACE_Time_Value& tv) +{ + t.sec = ACE_Utils::truncate_cast(tv.sec()); + t.nanosec = ACE_Utils::truncate_cast(tv.usec() * 1000); +} ACE_INLINE OpenDDS_Dcps_Export DDS::Time_t time_value_to_time(const ACE_Time_Value& tv); ACE_INLINE OpenDDS_Dcps_Export -MonotonicTime_t time_value_to_monotonic_time(const ACE_Time_Value& tv); +MonotonicTime_t time_value_to_time(const ACE_Time_Value_T& tv); ACE_INLINE OpenDDS_Dcps_Export ACE_Time_Value duration_to_time_value(const DDS::Duration_t& t); diff --git a/dds/DCPS/Time_Helper.inl b/dds/DCPS/Time_Helper.inl index 83c850e60bb..aa4807079db 100644 --- a/dds/DCPS/Time_Helper.inl +++ b/dds/DCPS/Time_Helper.inl @@ -191,13 +191,6 @@ operator==(const MonotonicTime_t& t1, const MonotonicTime_t& t2) } #endif -ACE_INLINE -ACE_Time_Value time_to_time_value(const DDS::Time_t& t) -{ - ACE_Time_Value tv(t.sec, t.nanosec / 1000); - return tv; -} - ACE_INLINE DDS::Time_t time_value_to_time(const ACE_Time_Value& tv) { @@ -208,7 +201,7 @@ DDS::Time_t time_value_to_time(const ACE_Time_Value& tv) } ACE_INLINE -MonotonicTime_t time_value_to_monotonic_time(const ACE_Time_Value& tv) +MonotonicTime_t time_value_to_time(const ACE_Time_Value_T& tv) { MonotonicTime_t t; t.sec = ACE_Utils::truncate_cast(tv.sec()); diff --git a/dds/DCPS/Timers.cpp b/dds/DCPS/Timers.cpp index d935d4abe9f..87bc8cf8624 100644 --- a/dds/DCPS/Timers.cpp +++ b/dds/DCPS/Timers.cpp @@ -90,13 +90,16 @@ TimerId schedule(ACE_Reactor* reactor, } return InvalidTimerId; } + static const timespec one_ns = {0, 1}; itimerspec ts; ts.it_interval = interval.value(); - if (delay == TimeDuration()) { + if (delay < TimeDuration::zero_value) { + // expiration in the past, execute as soon as possible (see note about zeros below) + ts.it_value = one_ns; + } else if (delay == TimeDuration::zero_value) { // avoid zeros since that would disarm the timer // if the interval is positive, use that as the initial expiration - static const timespec one = {0, 1}; - ts.it_value = (interval == TimeDuration()) ? one : interval.value(); + ts.it_value = (interval == TimeDuration::zero_value) ? one_ns : interval.value(); } else { ts.it_value = delay.value(); } diff --git a/dds/DCPS/XTypes/DynamicDataWriterImpl.h b/dds/DCPS/XTypes/DynamicDataWriterImpl.h index e7240481e55..e661e5f79b9 100644 --- a/dds/DCPS/XTypes/DynamicDataWriterImpl.h +++ b/dds/DCPS/XTypes/DynamicDataWriterImpl.h @@ -26,7 +26,7 @@ class OpenDDS_Dcps_Export DynamicDataWriterImpl public: DDS::InstanceHandle_t register_instance(DDS::DynamicData_ptr instance) { - return register_instance_w_timestamp(instance, DCPS::SystemTimePoint::now().to_dds_time()); + return register_instance_w_timestamp(instance, DCPS::SystemTimePoint::now().to_idl_struct()); } DDS::InstanceHandle_t register_instance_w_timestamp( @@ -40,7 +40,7 @@ class OpenDDS_Dcps_Export DynamicDataWriterImpl DDS::DynamicData_ptr instance, DDS::InstanceHandle_t handle) { return unregister_instance_w_timestamp(instance, handle, - DCPS::SystemTimePoint::now().to_dds_time()); + DCPS::SystemTimePoint::now().to_idl_struct()); } DDS::ReturnCode_t unregister_instance_w_timestamp( @@ -52,7 +52,7 @@ class OpenDDS_Dcps_Export DynamicDataWriterImpl DDS::ReturnCode_t write(DDS::DynamicData_ptr instance_data, DDS::InstanceHandle_t handle) { - return write_w_timestamp(instance_data, handle, DCPS::SystemTimePoint::now().to_dds_time()); + return write_w_timestamp(instance_data, handle, DCPS::SystemTimePoint::now().to_idl_struct()); } DDS::ReturnCode_t write_w_timestamp(DDS::DynamicData_ptr instance_data, @@ -66,7 +66,7 @@ class OpenDDS_Dcps_Export DynamicDataWriterImpl DDS::DynamicData_ptr instance_data, DDS::InstanceHandle_t instance_handle) { return dispose_w_timestamp(instance_data, instance_handle, - DCPS::SystemTimePoint::now().to_dds_time()); + DCPS::SystemTimePoint::now().to_idl_struct()); } DDS::ReturnCode_t dispose_w_timestamp(DDS::DynamicData_ptr instance_data, diff --git a/dds/DCPS/transport/tcp/TcpDataLink.cpp b/dds/DCPS/transport/tcp/TcpDataLink.cpp index 628181c3c7e..b4897c38d24 100644 --- a/dds/DCPS/transport/tcp/TcpDataLink.cpp +++ b/dds/DCPS/transport/tcp/TcpDataLink.cpp @@ -321,7 +321,7 @@ OpenDDS::DCPS::TcpDataLink::send_graceful_disconnect_message() //header_data.message_length_ = 0; //header_data.sequence_ = 0; //DDS::Time_t source_timestamp - // = SystemTimePoint::now().to_dds_time(); + // = SystemTimePoint::now().to_idl_struct(); //header_data.source_timestamp_sec_ = source_timestamp.sec; //header_data.source_timestamp_nanosec_ = source_timestamp.nanosec; //header_data.coherency_group_ = 0; diff --git a/dds/FACE/FaceTSS.cpp b/dds/FACE/FaceTSS.cpp index 573bd14e745..edf1a80208e 100644 --- a/dds/FACE/FaceTSS.cpp +++ b/dds/FACE/FaceTSS.cpp @@ -878,7 +878,7 @@ void populate_header_received(const FACE::CONNECTION_ID_TYPE& connection_id, header.message_timestamp = convertTime(sinfo.source_timestamp); const OpenDDS::DCPS::SystemTimePoint now = OpenDDS::DCPS::SystemTimePoint::now(); - readers[connection_id]->sum_recvd_msgs_latency += (convertTime(now.to_dds_time()) - header.message_timestamp); + readers[connection_id]->sum_recvd_msgs_latency += (convertTime(now.to_idl_struct()) - header.message_timestamp); ++readers[connection_id]->total_msgs_recvd; if (OpenDDS::DCPS::DCPS_debug_level > 8) { diff --git a/dds/OpenddsDcpsExt.idl b/dds/OpenddsDcpsExt.idl index 84366fd3f89..90b354ee2fd 100644 --- a/dds/OpenddsDcpsExt.idl +++ b/dds/OpenddsDcpsExt.idl @@ -9,6 +9,7 @@ #define OPENDDS_DCPS_EXT_IDL #include +#include #include #if defined __OPENDDS_IDL && !defined DDS_HAS_MINIMUM_BIT @@ -74,6 +75,7 @@ module OpenDDS struct InternalThreadBuiltinTopicData { BUILT_IN_TOPIC_KEY string thread_id; double utilization; + MonotonicTime_t monotonic_timestamp; }; const long LOCATOR_KIND_INVALID = -1; diff --git a/docs/devguide/built_in_topics.rst b/docs/devguide/built_in_topics.rst index 18b41983f51..f6f3ba16d2e 100644 --- a/docs/devguide/built_in_topics.rst +++ b/docs/devguide/built_in_topics.rst @@ -294,3 +294,5 @@ The topic type InternalThreadBuiltinTopicData is defined in :ghfile:`dds/Opendds * ``thread_id`` (key) -- A string identifier for the thread. * ``utilization`` -- Estimated utilization of this thread (0.0-1.0). + +* ``monotonic_timestamp`` -- Time of most recent update (monotonic clock). The SampleInfo's ``source_timestamp`` has the timestamp on the system clock. diff --git a/docs/news.d/thread-status-boottime.rst b/docs/news.d/thread-status-boottime.rst new file mode 100644 index 00000000000..78310d40f48 --- /dev/null +++ b/docs/news.d/thread-status-boottime.rst @@ -0,0 +1,14 @@ +.. news-prs: 4677 + +.. news-start-section: Additions +- Added a new data member, ``monotonic_timestamp`` to the ``InternalThreadBuiltInTopic`` IDL struct. + + - ``monotonic_timestamp`` is the time of the sample was written (time of last update of this instance) on the monotonic clock. + - On systems that don't support a monotonic clock, this will be the same value as the corresponding ``SampleInfo``'s ``source_timestamp``. +.. news-end-section + +.. news-start-section: Fixes +- When :cfg:prop:`DCPSThreadStatusInterval` is enabled, threads that run the ACE Reactor now use timers instead of a time-limited ``select()`` system call to update the ``InternalThreadBuiltInTopic``. + + - This allows the ``InternalThreadBuiltInTopic`` to be updated accurately on systems that suspend/resume and are configured for boottime timers. +.. news-end-section diff --git a/java/dds/.gitignore b/java/dds/.gitignore index a8b75c343dc..fada886db38 100644 --- a/java/dds/.gitignore +++ b/java/dds/.gitignore @@ -3,14 +3,51 @@ /*.vcproj /BitsExtJC.cpp /BitsJC.cpp +/classes +/DDS__ConditionTAOPeer.h +/DDS__ContentFilteredTopicTAOPeer.h +/DDS__DataReaderListenerTAOPeer.h +/DDS__DataReaderTAOPeer.h +/DDS__DataWriterListenerTAOPeer.h +/DDS__DataWriterTAOPeer.h +/DDS__DomainParticipantFactoryTAOPeer.h +/DDS__DomainParticipantListenerTAOPeer.h +/DDS__DomainParticipantTAOPeer.h +/DDS__EntityTAOPeer.h +/DDS__GuardConditionInterfTAOPeer.h +/DDS__MultiTopicTAOPeer.h +/DDS__ParticipantBuiltinTopicDataDataReaderTAOPeer.h +/DDS__ParticipantBuiltinTopicDataDataWriterTAOPeer.h +/DDS__ParticipantBuiltinTopicDataTypeSupportTAOPeer.h +/DDS__PublicationBuiltinTopicDataDataReaderTAOPeer.h +/DDS__PublicationBuiltinTopicDataDataWriterTAOPeer.h +/DDS__PublicationBuiltinTopicDataTypeSupportTAOPeer.h +/DDS__PublisherListenerTAOPeer.h +/DDS__PublisherTAOPeer.h +/DDS__QueryConditionTAOPeer.h +/DDS__ReadConditionTAOPeer.h +/DDS__StatusConditionTAOPeer.h +/DDS__SubscriberListenerTAOPeer.h +/DDS__SubscriberTAOPeer.h +/DDS__SubscriptionBuiltinTopicDataDataReaderTAOPeer.h +/DDS__SubscriptionBuiltinTopicDataDataWriterTAOPeer.h +/DDS__SubscriptionBuiltinTopicDataTypeSupportTAOPeer.h +/DDS__TopicBuiltinTopicDataDataReaderTAOPeer.h +/DDS__TopicBuiltinTopicDataDataWriterTAOPeer.h +/DDS__TopicBuiltinTopicDataTypeSupportTAOPeer.h +/DDS__TopicDescriptionTAOPeer.h +/DDS__TopicListenerTAOPeer.h +/DDS__TopicTAOPeer.h +/DDS__TypeSupportTAOPeer.h +/DDS__WaitSetInterfTAOPeer.h /DDS_ConditionHelper.h /DDS_ContentFilteredTopicHelper.h /DDS_DATAREADER_QOS_DEFAULT.h /DDS_DATAREADER_QOS_USE_TOPIC_QOS.h -/DDS_DATAWRITER_QOS_DEFAULT.h -/DDS_DATAWRITER_QOS_USE_TOPIC_QOS.h /DDS_DataReaderHelper.h /DDS_DataReaderListenerHelper.h +/DDS_DATAWRITER_QOS_DEFAULT.h +/DDS_DATAWRITER_QOS_USE_TOPIC_QOS.h /DDS_DataWriterHelper.h /DDS_DataWriterListenerHelper.h /DDS_DomainParticipantFactoryHelper.h @@ -22,7 +59,6 @@ /DDS_ListenerHelper.h /DDS_MultiTopicHelper.h /DDS_PARTICIPANT_QOS_DEFAULT.h -/DDS_PUBLISHER_QOS_DEFAULT.h /DDS_ParticipantBuiltinTopicDataDataReaderHelper.h /DDS_ParticipantBuiltinTopicDataDataWriterHelper.h /DDS_ParticipantBuiltinTopicDataTypeSupportHelper.h @@ -31,12 +67,13 @@ /DDS_PublicationBuiltinTopicDataDataWriterHelper.h /DDS_PublicationBuiltinTopicDataTypeSupportHelper.h /DDS_PublicationBuiltinTopicDataTypeSupportImpl.h +/DDS_PUBLISHER_QOS_DEFAULT.h /DDS_PublisherHelper.h /DDS_PublisherListenerHelper.h /DDS_QueryConditionHelper.h /DDS_ReadConditionHelper.h -/DDS_SUBSCRIBER_QOS_DEFAULT.h /DDS_StatusConditionHelper.h +/DDS_SUBSCRIBER_QOS_DEFAULT.h /DDS_SubscriberHelper.h /DDS_SubscriberListenerHelper.h /DDS_SubscriptionBuiltinTopicDataDataReaderHelper.h @@ -54,42 +91,6 @@ /DDS_TypeSupportHelper.h /DDS_WaitSet.h /DDS_WaitSetInterfHelper.h -/DDS__ConditionTAOPeer.h -/DDS__ContentFilteredTopicTAOPeer.h -/DDS__DataReaderListenerTAOPeer.h -/DDS__DataReaderTAOPeer.h -/DDS__DataWriterListenerTAOPeer.h -/DDS__DataWriterTAOPeer.h -/DDS__DomainParticipantFactoryTAOPeer.h -/DDS__DomainParticipantListenerTAOPeer.h -/DDS__DomainParticipantTAOPeer.h -/DDS__EntityTAOPeer.h -/DDS__GuardConditionInterfTAOPeer.h -/DDS__MultiTopicTAOPeer.h -/DDS__ParticipantBuiltinTopicDataDataReaderTAOPeer.h -/DDS__ParticipantBuiltinTopicDataDataWriterTAOPeer.h -/DDS__ParticipantBuiltinTopicDataTypeSupportTAOPeer.h -/DDS__PublicationBuiltinTopicDataDataReaderTAOPeer.h -/DDS__PublicationBuiltinTopicDataDataWriterTAOPeer.h -/DDS__PublicationBuiltinTopicDataTypeSupportTAOPeer.h -/DDS__PublisherListenerTAOPeer.h -/DDS__PublisherTAOPeer.h -/DDS__QueryConditionTAOPeer.h -/DDS__ReadConditionTAOPeer.h -/DDS__StatusConditionTAOPeer.h -/DDS__SubscriberListenerTAOPeer.h -/DDS__SubscriberTAOPeer.h -/DDS__SubscriptionBuiltinTopicDataDataReaderTAOPeer.h -/DDS__SubscriptionBuiltinTopicDataDataWriterTAOPeer.h -/DDS__SubscriptionBuiltinTopicDataTypeSupportTAOPeer.h -/DDS__TopicBuiltinTopicDataDataReaderTAOPeer.h -/DDS__TopicBuiltinTopicDataDataWriterTAOPeer.h -/DDS__TopicBuiltinTopicDataTypeSupportTAOPeer.h -/DDS__TopicDescriptionTAOPeer.h -/DDS__TopicListenerTAOPeer.h -/DDS__TopicTAOPeer.h -/DDS__TypeSupportTAOPeer.h -/DDS__WaitSetInterfTAOPeer.h /DdsDcpsConditionSeqJC.cpp /DdsDcpsConditionSeqJC.h /DdsDcpsCoreJC.cpp @@ -104,6 +105,8 @@ /DdsDcpsDomainJC.h /DdsDcpsGuidJC.cpp /DdsDcpsGuidJC.h +/DdsDcpsInfoUtilsJC.cpp +/DdsDcpsInfoUtilsJC.h /DdsDcpsInfrastructureJC.cpp /DdsDcpsInfrastructureJC.h /DdsDcpsInfrastructureTypeSupportJC.cpp @@ -118,6 +121,20 @@ /DdsDcpsTopicJC.h /DdsDcpsTypeSupportExtJC.cpp /DdsDcpsTypeSupportExtJC.h +/OpenDDS_DCPS__ConfigStoreTAOPeer.h +/OpenDDS_DCPS__ConnectionRecordDataReaderTAOPeer.h +/OpenDDS_DCPS__ConnectionRecordDataWriterTAOPeer.h +/OpenDDS_DCPS__ConnectionRecordTypeSupportTAOPeer.h +/OpenDDS_DCPS__DataReaderExTAOPeer.h +/OpenDDS_DCPS__DataReaderListenerTAOPeer.h +/OpenDDS_DCPS__DataWriterListenerTAOPeer.h +/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataReaderTAOPeer.h +/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataWriterTAOPeer.h +/OpenDDS_DCPS__InternalThreadBuiltinTopicDataTypeSupportTAOPeer.h +/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.h +/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.h +/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.h +/OpenDDS_DCPS__TypeSupportTAOPeer.h /OpenDDS_DCPS_CdrRepresentationFormatHelper.h /OpenDDS_DCPS_ConfigStoreHelper.h /OpenDDS_DCPS_ConnectionRecordDataReaderHelper.h @@ -140,21 +157,6 @@ /OpenDDS_DCPS_RepresentationFormatHelper.h /OpenDDS_DCPS_TheParticipantFactory.h /OpenDDS_DCPS_TheServiceParticipant.h -/OpenDDS_DCPS_TypeSupportHelper.h -/OpenDDS_DCPS__ConfigStoreTAOPeer.h -/OpenDDS_DCPS__ConnectionRecordDataReaderTAOPeer.h -/OpenDDS_DCPS__ConnectionRecordDataWriterTAOPeer.h -/OpenDDS_DCPS__ConnectionRecordTypeSupportTAOPeer.h -/OpenDDS_DCPS__DataReaderExTAOPeer.h -/OpenDDS_DCPS__DataReaderListenerTAOPeer.h -/OpenDDS_DCPS__DataWriterListenerTAOPeer.h -/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataReaderTAOPeer.h -/OpenDDS_DCPS__InternalThreadBuiltinTopicDataDataWriterTAOPeer.h -/OpenDDS_DCPS__InternalThreadBuiltinTopicDataTypeSupportTAOPeer.h -/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.h -/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.h -/OpenDDS_DCPS__ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.h -/OpenDDS_DCPS__TypeSupportTAOPeer.h /OpenDDS_DCPS_transport_MulticastInst.h /OpenDDS_DCPS_transport_RtpsUdpInst.h /OpenDDS_DCPS_transport_TcpInst.h @@ -162,8 +164,8 @@ /OpenDDS_DCPS_transport_TransportConfig.h /OpenDDS_DCPS_transport_TransportInst.h /OpenDDS_DCPS_transport_UdpInst.h +/OpenDDS_DCPS_TypeSupportHelper.h /OpenddsDcpsExtJC.cpp /OpenddsDcpsExtJC.h /OpenddsDcpsExtTypeSupportJC.cpp /OpenddsDcpsExtTypeSupportJC.h -/classes diff --git a/java/dds/OpenDDS/DCPS/.gitignore b/java/dds/OpenDDS/DCPS/.gitignore index 4d19b4eb4cb..8b523302bc0 100644 --- a/java/dds/OpenDDS/DCPS/.gitignore +++ b/java/dds/OpenDDS/DCPS/.gitignore @@ -1,3 +1,50 @@ +/_CdrRepresentationFormatLocalBase.java +/_CdrRepresentationFormatTAOPeer.java +/_ConfigStoreLocalBase.java +/_ConfigStoreTAOPeer.java +/_ConnectionDataDataReaderLocalBase.java +/_ConnectionDataDataReaderTAOPeer.java +/_ConnectionDataDataWriterLocalBase.java +/_ConnectionDataDataWriterTAOPeer.java +/_ConnectionDataTypeSupportLocalBase.java +/_ConnectionDataTypeSupportTAOPeer.java +/_ConnectionRecordDataReaderLocalBase.java +/_ConnectionRecordDataReaderTAOPeer.java +/_ConnectionRecordDataWriterLocalBase.java +/_ConnectionRecordDataWriterTAOPeer.java +/_ConnectionRecordTypeSupportLocalBase.java +/_ConnectionRecordTypeSupportTAOPeer.java +/_DataReaderExLocalBase.java +/_DataReaderExTAOPeer.java +/_DataReaderListenerLocalBase.java +/_DataReaderListenerTAOPeer.java +/_DataWriterListenerLocalBase.java +/_DataWriterListenerTAOPeer.java +/_DomainParticipantExtLocalBase.java +/_DomainParticipantExtTAOPeer.java +/_InternalThreadBuiltinTopicDataDataReaderLocalBase.java +/_InternalThreadBuiltinTopicDataDataReaderTAOPeer.java +/_InternalThreadBuiltinTopicDataDataWriterLocalBase.java +/_InternalThreadBuiltinTopicDataDataWriterTAOPeer.java +/_InternalThreadBuiltinTopicDataTypeSupportLocalBase.java +/_InternalThreadBuiltinTopicDataTypeSupportTAOPeer.java +/_JsonRepresentationFormatLocalBase.java +/_JsonRepresentationFormatTAOPeer.java +/_ParticipantLocationBuiltinTopicDataDataReaderLocalBase.java +/_ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.java +/_ParticipantLocationBuiltinTopicDataDataWriterLocalBase.java +/_ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.java +/_ParticipantLocationBuiltinTopicDataTypeSupportLocalBase.java +/_ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.java +/_RepresentationFormatLocalBase.java +/_RepresentationFormatTAOPeer.java +/_SubscriberExtLocalBase.java +/_SubscriberExtTAOPeer.java +/_TypeSupportLocalBase.java +/_TypeSupportTAOPeer.java +/AddDomainStatus.java +/AddDomainStatusHelper.java +/AddDomainStatusHolder.java /ALL_STATUS_MASK.java /BudgetExceededStatus.java /BudgetExceededStatusHelper.java @@ -46,7 +93,9 @@ /ConnectionRecordTypeSupportHolder.java /ConnectionRecordTypeSupportImpl.java /ConnectionRecordTypeSupportOperations.java -/DEFAULT_STATUS_MASK.java +/ContentFilterProperty_t.java +/ContentFilterProperty_tHelper.java +/ContentFilterProperty_tHolder.java /DataReaderEx.java /DataReaderExHelper.java /DataReaderExHolder.java @@ -62,7 +111,14 @@ /DataWriterListenerHelper.java /DataWriterListenerHolder.java /DataWriterListenerOperations.java +/DEFAULT_STATUS_MASK.java /DisassociationStatusHelper.java +/DiscoveredReaderData.java +/DiscoveredReaderDataHelper.java +/DiscoveredReaderDataHolder.java +/DiscoveredWriterData.java +/DiscoveredWriterDataHelper.java +/DiscoveredWriterDataHolder.java /DomainParticipantExt.java /DomainParticipantExtHelper.java /DomainParticipantExtHolder.java @@ -70,6 +126,11 @@ /DurabilityQosPolicyExt.java /DurabilityQosPolicyExtHelper.java /DurabilityQosPolicyExtHolder.java +/EntityId_t.java +/EntityId_tHelper.java +/EntityId_tHolder.java +/EntityKey_tHelper.java +/EntityKey_tHolder.java /ENTITYKIND_BUILTIN_PARTICIPANT.java /ENTITYKIND_BUILTIN_READER_NO_KEY.java /ENTITYKIND_BUILTIN_READER_WITH_KEY.java @@ -87,13 +148,6 @@ /ENTITYKIND_USER_UNKNOWN.java /ENTITYKIND_USER_WRITER_NO_KEY.java /ENTITYKIND_USER_WRITER_WITH_KEY.java -/EntityId_t.java -/EntityId_tHelper.java -/EntityId_tHolder.java -/EntityKey_tHelper.java -/EntityKey_tHolder.java -/GUIDSeqHelper.java -/GUIDSeqHolder.java /GUID_t.java /GUID_tHelper.java /GUID_tHolder.java @@ -104,8 +158,13 @@ /GuidCountSequenceHolder.java /GuidPrefix_tHelper.java /GuidPrefix_tHolder.java +/GUIDSeqHelper.java +/GUIDSeqHolder.java /GuidVendorId_tHelper.java /GuidVendorId_tHolder.java +/IncompatibleQosStatus.java +/IncompatibleQosStatusHelper.java +/IncompatibleQosStatusHolder.java /InternalThreadBuiltinTopicData.java /InternalThreadBuiltinTopicDataDataReader.java /InternalThreadBuiltinTopicDataDataReaderHelper.java @@ -129,6 +188,11 @@ /JsonRepresentationFormatHelper.java /JsonRepresentationFormatHolder.java /JsonRepresentationFormatOperations.java +/LatencyStatistics.java +/LatencyStatisticsHelper.java +/LatencyStatisticsHolder.java +/LatencyStatisticsSeqHelper.java +/LatencyStatisticsSeqHolder.java /LOCATION_ICE.java /LOCATION_ICE6.java /LOCATION_LOCAL.java @@ -140,16 +204,11 @@ /LOCATOR_KIND_UDPv4.java /LOCATOR_KIND_UDPv6.java /LOCATOR_PORT_INVALID.java -/LatencyStatistics.java -/LatencyStatisticsHelper.java -/LatencyStatisticsHolder.java -/LatencyStatisticsSeqHelper.java -/LatencyStatisticsSeqHolder.java -/LocatorSeqHelper.java -/LocatorSeqHolder.java /Locator_t.java /Locator_tHelper.java /Locator_tHolder.java +/LocatorSeqHelper.java +/LocatorSeqHolder.java /MCK_RTPS.java /MCK_STUN.java /MessageCount.java @@ -188,11 +247,20 @@ /PublicationLostStatusHelper.java /PublicationLostStatusHolder.java /PublicationReconnectedStatusHelper.java -/RTPS_RELAY_STUN_PROTOCOL.java +/ReaderAssociation.java +/ReaderAssociationHelper.java +/ReaderAssociationHolder.java +/ReaderIdSeqHelper.java +/ReaderIdSeqHolder.java +/ReaderProxy_t.java +/ReaderProxy_tHelper.java +/ReaderProxy_tHolder.java /RepresentationFormat.java /RepresentationFormatHelper.java /RepresentationFormatHolder.java /RepresentationFormatOperations.java +/RTPS_RELAY_STUN_PROTOCOL.java +/String256Helper.java /SubscriberExt.java /SubscriberExtHelper.java /SubscriberExtHolder.java @@ -202,6 +270,15 @@ /SubscriptionLostStatusHelper.java /SubscriptionLostStatusHolder.java /SubscriptionReconnectedStatusHelper.java +/TopicStatus.java +/TopicStatusHelper.java +/TopicStatusHolder.java +/TransportBLOBHelper.java +/TransportLocator.java +/TransportLocatorHelper.java +/TransportLocatorHolder.java +/TransportLocatorSeqHelper.java +/TransportLocatorSeqHolder.java /TransportStatistics.java /TransportStatisticsHelper.java /TransportStatisticsHolder.java @@ -213,47 +290,11 @@ /TypeSupportOperations.java /UNALIGNED_CDR_DATA_REPRESENTATION.java /UNALIGNED_CDR_DATA_REPRESENTATION.java -/_CdrRepresentationFormatLocalBase.java -/_CdrRepresentationFormatTAOPeer.java -/_ConfigStoreLocalBase.java -/_ConfigStoreTAOPeer.java -/_ConnectionDataDataReaderLocalBase.java -/_ConnectionDataDataReaderTAOPeer.java -/_ConnectionDataDataWriterLocalBase.java -/_ConnectionDataDataWriterTAOPeer.java -/_ConnectionDataTypeSupportLocalBase.java -/_ConnectionDataTypeSupportTAOPeer.java -/_ConnectionRecordDataReaderLocalBase.java -/_ConnectionRecordDataReaderTAOPeer.java -/_ConnectionRecordDataWriterLocalBase.java -/_ConnectionRecordDataWriterTAOPeer.java -/_ConnectionRecordTypeSupportLocalBase.java -/_ConnectionRecordTypeSupportTAOPeer.java -/_DataReaderExLocalBase.java -/_DataReaderExTAOPeer.java -/_DataReaderListenerLocalBase.java -/_DataReaderListenerTAOPeer.java -/_DataWriterListenerLocalBase.java -/_DataWriterListenerTAOPeer.java -/_DomainParticipantExtLocalBase.java -/_DomainParticipantExtTAOPeer.java -/_InternalThreadBuiltinTopicDataDataReaderLocalBase.java -/_InternalThreadBuiltinTopicDataDataReaderTAOPeer.java -/_InternalThreadBuiltinTopicDataDataWriterLocalBase.java -/_InternalThreadBuiltinTopicDataDataWriterTAOPeer.java -/_InternalThreadBuiltinTopicDataTypeSupportLocalBase.java -/_InternalThreadBuiltinTopicDataTypeSupportTAOPeer.java -/_JsonRepresentationFormatLocalBase.java -/_JsonRepresentationFormatTAOPeer.java -/_ParticipantLocationBuiltinTopicDataDataReaderLocalBase.java -/_ParticipantLocationBuiltinTopicDataDataReaderTAOPeer.java -/_ParticipantLocationBuiltinTopicDataDataWriterLocalBase.java -/_ParticipantLocationBuiltinTopicDataDataWriterTAOPeer.java -/_ParticipantLocationBuiltinTopicDataTypeSupportLocalBase.java -/_ParticipantLocationBuiltinTopicDataTypeSupportTAOPeer.java -/_RepresentationFormatLocalBase.java -/_RepresentationFormatTAOPeer.java -/_SubscriberExtLocalBase.java -/_SubscriberExtTAOPeer.java -/_TypeSupportLocalBase.java -/_TypeSupportTAOPeer.java +/WriterAssociation.java +/WriterAssociationHelper.java +/WriterAssociationHolder.java +/WriterIdSeqHelper.java +/WriterIdSeqHolder.java +/WriterProxy_t.java +/WriterProxy_tHelper.java +/WriterProxy_tHolder.java diff --git a/java/dds/dcps_java.mpc b/java/dds/dcps_java.mpc index 8bed02fdf28..d9d5f91d118 100644 --- a/java/dds/dcps_java.mpc +++ b/java/dds/dcps_java.mpc @@ -24,7 +24,8 @@ project: idl2jni, javah, dcpslib, optional_jni_check, dcps_java_optional, dcps_m Idl2Jni_Files { $(DDS_ROOT)/dds/DdsDcpsCore.idl - $(DDS_ROOT)/dds/OpenddsDcpsExt.idl + $(DDS_ROOT)/dds/DdsDcpsInfoUtils.idl + $(DDS_ROOT)/dds/OpenddsDcpsExt.idl << DdsDcpsInfoUtilsJC.h $(DDS_ROOT)/dds/DdsDcpsInfrastructure.idl << DdsDcpsConditionSeqJC.h $(DDS_ROOT)/dds/DdsDcpsDomain.idl << DdsDcpsTopicJC.h DdsDcpsSubscriptionJC.h DdsDcpsPublicationJC.h $(DDS_ROOT)/dds/DdsDcpsGuid.idl diff --git a/java/tests/internal_thread_status/InternalThreadListener.java b/java/tests/internal_thread_status/InternalThreadListener.java index 76fc50e8c80..628c8e8e611 100644 --- a/java/tests/internal_thread_status/InternalThreadListener.java +++ b/java/tests/internal_thread_status/InternalThreadListener.java @@ -36,7 +36,7 @@ public synchronized void on_data_available(DDS.DataReader reader) { InternalThreadBuiltinTopicDataHolder info = new InternalThreadBuiltinTopicDataHolder( - new InternalThreadBuiltinTopicData("", 0.0)); + new InternalThreadBuiltinTopicData("", 0.0, new MonotonicTime_t())); SampleInfoHolder si = new SampleInfoHolder(new SampleInfo(0, 0, 0, new DDS.Time_t(), 0, 0, 0, 0, 0, 0, 0, false, 0)); @@ -48,6 +48,7 @@ public synchronized void on_data_available(DDS.DataReader reader) { System.out.println("== " + id + " Thread Info =="); System.out.println(" tid: " + info.value.thread_id); System.out.println("utilization: " + info.value.utilization); + System.out.println(" monotonic: " + info.value.monotonic_timestamp.sec); System.out.println(" time: " + si.value.source_timestamp.sec); } } diff --git a/tests/DCPS/InternalThreadStatus/InternalThreadStatusListenerImpl.cpp b/tests/DCPS/InternalThreadStatus/InternalThreadStatusListenerImpl.cpp index ca1043547a4..9f21a0138bc 100644 --- a/tests/DCPS/InternalThreadStatus/InternalThreadStatusListenerImpl.cpp +++ b/tests/DCPS/InternalThreadStatus/InternalThreadStatusListenerImpl.cpp @@ -58,6 +58,7 @@ void InternalThreadStatusListenerImpl::on_data_available(DDS::DataReader_ptr rea std::cout << " tid: " << thread_info.thread_id << "\n" + << "mtime: " << thread_info.monotonic_timestamp.sec << '\n' << " time: " << si.source_timestamp.sec << std::endl; } } diff --git a/tests/DCPS/InternalThreadStatus/rtps.ini b/tests/DCPS/InternalThreadStatus/rtps.ini index 6c77fe6aa01..a865ae6c39e 100644 --- a/tests/DCPS/InternalThreadStatus/rtps.ini +++ b/tests/DCPS/InternalThreadStatus/rtps.ini @@ -11,3 +11,4 @@ transport_type=rtps_udp DiscoveryConfig=application_rtps_discovery [rtps_discovery/application_rtps_discovery] +ResendPeriod=2 diff --git a/tests/dcps_tests.lst b/tests/dcps_tests.lst index efe998a25c7..df79cd9044c 100644 --- a/tests/dcps_tests.lst +++ b/tests/dcps_tests.lst @@ -344,7 +344,7 @@ tests/DCPS/Thrasher/run_test.pl default rtps: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl low rtps: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl medium rtps: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl high rtps: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN -tests/DCPS/Thrasher/run_test.pl aggressive rtps: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN +tests/DCPS/Thrasher/run_test.pl aggressive rtps: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN !BOOTTIME_TIMERS tests/DCPS/Thrasher/run_test.pl single durable: !DCPS_MIN !LYNXOS !OPENDDS_SAFETY_PROFILE tests/DCPS/Thrasher/run_test.pl double durable: !DCPS_MIN !LYNXOS !OPENDDS_SAFETY_PROFILE tests/DCPS/Thrasher/run_test.pl triangle durable: !DCPS_MIN !LYNXOS !OPENDDS_SAFETY_PROFILE @@ -360,7 +360,7 @@ tests/DCPS/Thrasher/run_test.pl default rtps durable: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl low rtps durable: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl medium rtps durable: !DCPS_MIN RTPS !LYNXOS tests/DCPS/Thrasher/run_test.pl high rtps durable: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN -tests/DCPS/Thrasher/run_test.pl aggressive rtps durable: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN +tests/DCPS/Thrasher/run_test.pl aggressive rtps durable: !DCPS_MIN RTPS !LYNXOS !OPENDDS_SAFETY_PROFILE !GH_ACTIONS_ASAN !BOOTTIME_TIMERS tests/DCPS/DPFactoryQos/run_test.pl: !DCPS_MIN tests/DCPS/DPFactoryQos/run_test.pl rtps_disc: !DCPS_MIN RTPS tests/DCPS/ManualAssertLiveliness/run_test.pl: !DCPS_MIN !OPENDDS_SAFETY_PROFILE diff --git a/tests/unit-tests/dds/DCPS/Timers.cpp b/tests/unit-tests/dds/DCPS/Timers.cpp index e466857ee85..1d86c648001 100644 --- a/tests/unit-tests/dds/DCPS/Timers.cpp +++ b/tests/unit-tests/dds/DCPS/Timers.cpp @@ -64,3 +64,18 @@ TEST(dds_DCPS_Timers, test_immediate) ASSERT_EQ(handler->calls_, 1); Timers::cancel(&reactor, id); } + +TEST(dds_DCPS_Timers, test_negative) +{ + RcHandle handler = make_rch(); + ACE_Reactor reactor(new ACE_Select_Reactor, true); + + const Timers::TimerId id = Timers::schedule(&reactor, *handler, 0, TimeDuration(-23)); + ASSERT_NE(id, Timers::InvalidTimerId); + + ACE_Time_Value one_sec(1); + reactor.handle_events(one_sec); + + ASSERT_EQ(handler->calls_, 1); + Timers::cancel(&reactor, id); +} diff --git a/tools/rtpsrelay/RelayParticipantStatusReporter.cpp b/tools/rtpsrelay/RelayParticipantStatusReporter.cpp index c7ee2630bbb..1c65d6ac1db 100644 --- a/tools/rtpsrelay/RelayParticipantStatusReporter.cpp +++ b/tools/rtpsrelay/RelayParticipantStatusReporter.cpp @@ -7,7 +7,7 @@ void RelayParticipantStatusReporter::add_participant(const OpenDDS::DCPS::GUID_t { const auto monotonic_now = OpenDDS::DCPS::MonotonicTimePoint::now(); const auto system_now = OpenDDS::DCPS::SystemTimePoint::now(); - const DDS::Time_t timestamp = system_now.to_dds_time(); + const DDS::Time_t timestamp = system_now.to_idl_struct(); RelayParticipantStatus status; status.relay_id(config_.relay_id()); @@ -94,7 +94,7 @@ void RelayParticipantStatusReporter::set_alive(const OpenDDS::DCPS::GUID_t& repo } pos->second.alive(alive); - pos->second.alive_ts(system_now.to_dds_time()); + pos->second.alive_ts(system_now.to_idl_struct()); if (writer_->write(pos->second, DDS::HANDLE_NIL) != DDS::RETCODE_OK) { ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: " @@ -120,7 +120,7 @@ void RelayParticipantStatusReporter::set_active(const OpenDDS::DCPS::GUID_t& rep } pos->second.active(active); - pos->second.active_ts(system_now.to_dds_time()); + pos->second.active_ts(system_now.to_idl_struct()); if (writer_->write(pos->second, DDS::HANDLE_NIL) != DDS::RETCODE_OK) { ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: " @@ -146,7 +146,7 @@ void RelayParticipantStatusReporter::set_alive_active(const OpenDDS::DCPS::GUID_ return; } - const DDS::Time_t timestamp = system_now.to_dds_time(); + const DDS::Time_t timestamp = system_now.to_idl_struct(); if (pos->second.alive() != alive) { pos->second.alive(alive); pos->second.alive_ts(timestamp);