Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into igtd/cmake-build
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Oct 12, 2023
2 parents dd927cd + 588ad82 commit be7de0f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4385,6 +4385,8 @@ jobs:
run: |
tar xvJf openssl3_u20.tar.xz
rm -f openssl3_u20.tar.xz
- name: Update apt indexes
run: sudo apt-get -y update
- name: install xerces and valgrind
run: sudo apt-get -y install libxerces-c-dev valgrind
- name: checkout MPC
Expand Down
26 changes: 10 additions & 16 deletions dds/DCPS/ReactorTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int ReactorTask::svc()

// Tell the reactor to handle events.
if (thread_status_manager_->update_thread_status()) {
while (state_ == STATE_RUNNING) {
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);
Expand Down Expand Up @@ -223,23 +223,17 @@ void ReactorTask::stop()
reactor->end_reactor_event_loop();
}

{
GuardType guard(lock_);

// In the future, we will likely want to replace this assert with a new "SHUTTING_DOWN" state
// which can be used to delay any potential new calls to open_reactor_task()
OPENDDS_ASSERT(state_ == STATE_SHUT_DOWN);
// In the future, we will likely want to replace this assert with a new "SHUTTING_DOWN" state
// which can be used to delay any potential new calls to open_reactor_task()
OPENDDS_ASSERT(state() == STATE_SHUT_DOWN);

// Let's wait for the reactor task's thread to complete before we
// leave this stop method.
if (thread_status_manager_) {
ThreadStatusManager::Sleeper sleeper(*thread_status_manager_);
wait();
// Let's wait for the reactor task's thread to complete before we
// leave this stop method.
ThreadStatusManager::Sleeper sleeper(thread_status_manager_);
wait();

// Reset the thread manager in case it goes away before the next open.
thr_mgr(0);
}
}
// Reset the thread manager in case it goes away before the next open.
thr_mgr(0);
}

void ReactorTask::reactor(ACE_Reactor* reactor)
Expand Down
1 change: 1 addition & 0 deletions dds/DCPS/ReactorTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public virtual RcObject {
ACE_SYNCH_RECURSIVE_MUTEX, MonotonicClock> TimerQueueType;

enum State { STATE_UNINITIALIZED, STATE_OPENING, STATE_RUNNING, STATE_SHUT_DOWN };
State state() const;

class Interceptor : public DCPS::ReactorInterceptor {
public:
Expand Down
7 changes: 7 additions & 0 deletions dds/DCPS/ReactorTask.inl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ ReactorInterceptor_rch ReactorTask::interceptor() const
return interceptor_;
}

ACE_INLINE
ReactorTask::State ReactorTask::state() const
{
ACE_Guard<ACE_SYNCH_MUTEX> guard(lock_);
return state_;
}

} // namespace DCPS
} // namespace OpenDDS

Expand Down
18 changes: 14 additions & 4 deletions dds/DCPS/ThreadStatusManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,29 @@ class OpenDDS_Dcps_Export ThreadStatusManager {

class Sleeper {
public:
Sleeper(ThreadStatusManager& thread_status_manager)
explicit Sleeper(ThreadStatusManager* thread_status_manager)
: thread_status_manager_(thread_status_manager)
{
thread_status_manager_.idle();
if (thread_status_manager_) {
thread_status_manager_->idle();
}
}

explicit Sleeper(ThreadStatusManager& thread_status_manager)
: thread_status_manager_(&thread_status_manager)
{
thread_status_manager_->idle();
}

~Sleeper()
{
thread_status_manager_.active();
if (thread_status_manager_) {
thread_status_manager_->active();
}
}

private:
ThreadStatusManager& thread_status_manager_;
ThreadStatusManager* const thread_status_manager_;
};

/// Copy active and idle threads to running and finished threads to
Expand Down
4 changes: 2 additions & 2 deletions docs/devguide/building/cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ install(IMPORTED_RUNTIME_ARTIFACTS)

.. versionadded:: 3.20

If using CMake 3.21 or later, it’s possible to install :ref:`executables <cmake-executables>` and :ref:`shared libraries <cmake-libraries>` from OpenDDS, ACE, and TAO in CMake along side the application using `install(IMPORTED_RUNTIME_ARTIFACTS) <https://cmake.org/cmake/help/latest/command/install.html#install-imported-runtime-artifacts>`__.
If using CMake 3.21 or later, it’s possible to install :ref:`executables <cmake-executables>` and :ref:`shared libraries <cmake-libraries>` from OpenDDS, ACE, and TAO in CMake along side the application using `install(IMPORTED_RUNTIME_ARTIFACTS) <https://cmake.org/cmake/help/latest/command/install.html#imported-runtime-artifacts>`__.
This will just install shared libraries and executables, not static libraries, headers, or anything else required for building applications.

If OpenDDS and ACE/TAO is built with ``clang``, the shared libraries might be missing an ``SONAME`` entry.
Expand All @@ -212,7 +212,7 @@ It is possible to install files from the :ref:`OPENDDS_*_INTERFACE_FILES target
See the :ghfile:`install Test <tests/cmake/install/library/CMakeLists.txt>` for an example of this.
It uses `install(FILES) <https://cmake.org/cmake/help/latest/command/install.html#files>`__, but there isn't any restriction on what installation method can be used.
For example, the `PUBLIC_HEADER <https://cmake.org/cmake/help/latest/prop_tgt/PUBLIC_HEADER.html>`__ target property could be set on target to the desired files from the interface lists.
Then they can be installed using `install(TARGETS ... PUBLIC_HEADER ...) <https://cmake.org/cmake/help/latest/command/install.html#installing-targets>`__.
Then they could be installed using `install(TARGETS ... PUBLIC_HEADER ...) <https://cmake.org/cmake/help/latest/command/install.html#targets>`__.
Another method is provided by :cmake:func:`opendds_install_interface_files`.

Manually Creating config.cmake
Expand Down

0 comments on commit be7de0f

Please sign in to comment.