From 2699a3b83460e85462c5738ebdfc7347ef4a7585 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 28 Nov 2023 19:26:46 +0100 Subject: [PATCH] iox-#1391 Move 'mutex' to new location --- .../release-notes/iceoryx-unreleased.md | 6 +- iceoryx_hoofs/CMakeLists.txt | 2 +- .../sync/include/iox}/mutex.hpp | 28 ++++---- .../sync/source}/mutex.cpp | 9 +-- .../test/moduletests/test_posix_mutex.cpp | 67 +++++++++---------- .../chunk_distributor_data.hpp | 2 +- .../popo/building_blocks/locking_policy.hpp | 4 +- .../internal/runtime/posh_runtime_impl.hpp | 4 +- .../popo/building_blocks/locking_policy.cpp | 6 +- .../source/runtime/posh_runtime_impl.cpp | 6 +- .../test_popo_chunk_building_blocks.cpp | 1 - .../test_popo_port_user_building_blocks.cpp | 1 - 12 files changed, 62 insertions(+), 74 deletions(-) rename iceoryx_hoofs/{include/iceoryx_hoofs/internal/posix_wrapper => posix/sync/include/iox}/mutex.hpp (90%) rename iceoryx_hoofs/{source/posix_wrapper => posix/sync/source}/mutex.cpp (98%) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index c0faefb2c7..46f1fdb336 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -651,9 +651,9 @@ myMutex.lock(); // after - iox::optional myMutex; - iox::posix::MutexBuilder() - .mutexType(iox::posix::MutexType::RECURSIVE) + iox::optional myMutex; + iox::MutexBuilder() + .mutexType(iox::MutexType::RECURSIVE) .create(myMutex); myMutex->lock(); ``` diff --git a/iceoryx_hoofs/CMakeLists.txt b/iceoryx_hoofs/CMakeLists.txt index 300b453d41..1801e64d8a 100644 --- a/iceoryx_hoofs/CMakeLists.txt +++ b/iceoryx_hoofs/CMakeLists.txt @@ -104,7 +104,6 @@ iox_add_library( source/cxx/requires.cpp source/error_handling/error_handler.cpp source/error_handling/error_handling.cpp - source/posix_wrapper/mutex.cpp source/posix_wrapper/scheduler.cpp source/posix_wrapper/shared_memory_object.cpp source/posix_wrapper/shared_memory_object/memory_map.cpp @@ -122,6 +121,7 @@ iox_add_library( posix/filesystem/source/file.cpp posix/filesystem/source/file_lock.cpp posix/filesystem/source/posix_acl.cpp + posix/sync/source/mutex.cpp posix/sync/source/named_semaphore.cpp posix/sync/source/semaphore_interface.cpp posix/sync/source/thread.cpp diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp b/iceoryx_hoofs/posix/sync/include/iox/mutex.hpp similarity index 90% rename from iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp rename to iceoryx_hoofs/posix/sync/include/iox/mutex.hpp index 7037035311..8dc7de894a 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/mutex.hpp +++ b/iceoryx_hoofs/posix/sync/include/iox/mutex.hpp @@ -14,8 +14,9 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_POSIX_WRAPPER_MUTEX_HPP -#define IOX_HOOFS_POSIX_WRAPPER_MUTEX_HPP + +#ifndef IOX_HOOFS_POSIX_SYNC_MUTEX_HPP +#define IOX_HOOFS_POSIX_SYNC_MUTEX_HPP #include "iceoryx_platform/pthread.hpp" #include "iox/builder.hpp" @@ -24,8 +25,6 @@ namespace iox { -namespace posix -{ enum class MutexCreationError { MUTEX_ALREADY_INITIALIZED, @@ -71,23 +70,23 @@ enum class MutexTryLock /// @brief Wrapper for a inter-process pthread based mutex which does not use /// exceptions! /// @code -/// #include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" +/// #include "iox/mutex.hpp" /// /// int main() { -/// optional myMutex; -/// iox::posix::MutexBuilder().isInterProcessCapable(true) -/// .mutexType(MutexType::RECURSIVE) -/// .priorityInheritance(MutexPriorityInheritance::NONE) -/// .threadTerminationBehavior(MutexThreadTerminationBehavior::RELEASE_WHEN_LOCKED) -/// .create(myMutex) -/// .expect("Failed to create mutex!"); +/// optional myMutex; +/// iox::MutexBuilder().isInterProcessCapable(true) +/// .mutexType(MutexType::RECURSIVE) +/// .priorityInheritance(MutexPriorityInheritance::NONE) +/// .threadTerminationBehavior(MutexThreadTerminationBehavior::RELEASE_WHEN_LOCKED) +/// .create(myMutex) +/// .expect("Failed to create mutex!"); /// /// myMutex->lock().expect("Mutex lock failed. Maybe the system is corrupted."); /// // ... do stuff /// myMutex->unlock().expect("Mutex unlock failed. Maybe the system is corrupted."); /// /// { -/// std::lock_guard lock(*myMutex); +/// std::lock_guard lock(*myMutex); /// // ... /// } /// @@ -220,7 +219,6 @@ class MutexBuilder /// @return On failure MutexError which explains the error expected create(optional& uninitializedMutex) noexcept; }; -} // namespace posix } // namespace iox -#endif // IOX_HOOFS_POSIX_WRAPPER_MUTEX_HPP +#endif // IOX_HOOFS_POSIX_SYNC_MUTEX_HPP diff --git a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp b/iceoryx_hoofs/posix/sync/source/mutex.cpp similarity index 98% rename from iceoryx_hoofs/source/posix_wrapper/mutex.cpp rename to iceoryx_hoofs/posix/sync/source/mutex.cpp index 81d3c0610c..cf6d1769fb 100644 --- a/iceoryx_hoofs/source/posix_wrapper/mutex.cpp +++ b/iceoryx_hoofs/posix/sync/source/mutex.cpp @@ -15,7 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" +#include "iox/mutex.hpp" #include "iceoryx_hoofs/posix_wrapper/scheduler.hpp" #include "iox/logging.hpp" #include "iox/posix_call.hpp" @@ -24,8 +24,6 @@ namespace iox { -namespace posix -{ /// @brief Internal struct used during mutex construction to handle all the mutex attribute settings struct MutexAttributes { @@ -157,8 +155,8 @@ struct MutexAttributes return err(MutexCreationError::PRIORITIES_UNSUPPORTED_BY_PLATFORM); case EINVAL: { - auto minimumPriority = getSchedulerPriorityMinimum(Scheduler::FIFO); - auto maximumPriority = getSchedulerPriorityMaximum(Scheduler::FIFO); + auto minimumPriority = posix::getSchedulerPriorityMinimum(posix::Scheduler::FIFO); + auto maximumPriority = posix::getSchedulerPriorityMaximum(posix::Scheduler::FIFO); IOX_LOG(ERROR, "The priority ceiling \"" << priorityCeiling << "\" is not in the valid priority range [ " @@ -411,5 +409,4 @@ expected mutex::try_lock() noexcept return (result->errnum == EBUSY) ? ok(MutexTryLock::FAILED_TO_ACQUIRE_LOCK) : ok(MutexTryLock::LOCK_SUCCEEDED); } -} // namespace posix } // namespace iox diff --git a/iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp b/iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp index f614987365..db4cbfa138 100644 --- a/iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp +++ b/iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp @@ -15,10 +15,10 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" #include "iceoryx_hoofs/testing/test.hpp" #include "iceoryx_hoofs/testing/watch_dog.hpp" #include "iox/deadline_timer.hpp" +#include "iox/mutex.hpp" #include #include @@ -26,6 +26,7 @@ namespace { using namespace ::testing; +using namespace iox; using namespace iox::units::duration_literals; class Mutex_test : public Test @@ -35,10 +36,8 @@ class Mutex_test : public Test { deadlockWatchdog.watchAndActOnFailure([] { std::terminate(); }); - ASSERT_FALSE( - iox::posix::MutexBuilder().mutexType(iox::posix::MutexType::RECURSIVE).create(sutRecursive).has_error()); - ASSERT_FALSE( - iox::posix::MutexBuilder().mutexType(iox::posix::MutexType::NORMAL).create(sutNonRecursive).has_error()); + ASSERT_FALSE(MutexBuilder().mutexType(MutexType::RECURSIVE).create(sutRecursive).has_error()); + ASSERT_FALSE(MutexBuilder().mutexType(MutexType::NORMAL).create(sutNonRecursive).has_error()); } void TearDown() override @@ -65,8 +64,8 @@ class Mutex_test : public Test } std::atomic_bool doWaitForThread{true}; - iox::optional sutNonRecursive; - iox::optional sutRecursive; + iox::optional sutNonRecursive; + iox::optional sutRecursive; iox::units::Duration watchdogTimeout = 5_s; Watchdog deadlockWatchdog{watchdogTimeout}; }; @@ -76,7 +75,7 @@ TEST_F(Mutex_test, TryLockAndUnlockWithNonRecursiveMutexWorks) ::testing::Test::RecordProperty("TEST_ID", "4ed2c3f1-6c91-465e-a702-9ea25b5434bb"); auto tryLockResult = sutNonRecursive->try_lock(); ASSERT_FALSE(tryLockResult.has_error()); - EXPECT_THAT(*tryLockResult, Eq(iox::posix::MutexTryLock::LOCK_SUCCEEDED)); + EXPECT_THAT(*tryLockResult, Eq(MutexTryLock::LOCK_SUCCEEDED)); EXPECT_FALSE(sutNonRecursive->unlock().has_error()); } @@ -87,7 +86,7 @@ TEST_F(Mutex_test, TryLockWithNonRecursiveMutexReturnsFailsWhenLocked) EXPECT_FALSE(sutNonRecursive->lock().has_error()); auto tryLockResult = sutNonRecursive->try_lock(); ASSERT_FALSE(tryLockResult.has_error()); - EXPECT_THAT(*tryLockResult, Eq(iox::posix::MutexTryLock::FAILED_TO_ACQUIRE_LOCK)); + EXPECT_THAT(*tryLockResult, Eq(MutexTryLock::FAILED_TO_ACQUIRE_LOCK)); EXPECT_FALSE(sutNonRecursive->unlock().has_error()); } #endif @@ -108,9 +107,9 @@ TEST_F(Mutex_test, RepeatedLockAndUnlockWithNonRecursiveMutexWorks) EXPECT_FALSE(sutNonRecursive->unlock().has_error()); } -void tryLockReturnsFalseWhenMutexLockedInOtherThread(iox::posix::mutex& mutex) +void tryLockReturnsFalseWhenMutexLockedInOtherThread(mutex& mutex) { - std::atomic tryLockState = {iox::posix::MutexTryLock::LOCK_SUCCEEDED}; + std::atomic tryLockState = {MutexTryLock::LOCK_SUCCEEDED}; ASSERT_FALSE(mutex.lock().has_error()); std::thread lockThread([&] { auto tryLockResult = mutex.try_lock(); @@ -119,7 +118,7 @@ void tryLockReturnsFalseWhenMutexLockedInOtherThread(iox::posix::mutex& mutex) }); lockThread.join(); - EXPECT_THAT(tryLockState.load(), Eq(iox::posix::MutexTryLock::FAILED_TO_ACQUIRE_LOCK)); + EXPECT_THAT(tryLockState.load(), Eq(MutexTryLock::FAILED_TO_ACQUIRE_LOCK)); ASSERT_FALSE(mutex.unlock().has_error()); } @@ -136,7 +135,7 @@ TEST_F(Mutex_test, TryLockReturnsFalseWhenMutexLockedInOtherThreadRecursiveMutex tryLockReturnsFalseWhenMutexLockedInOtherThread(*sutRecursive); } -void lockedMutexBlocks(Mutex_test* test, iox::posix::mutex& mutex) +void lockedMutexBlocks(Mutex_test* test, mutex& mutex) { const std::chrono::milliseconds WAIT_IN_MS(100); @@ -175,13 +174,12 @@ TEST_F(Mutex_test, LockedMutexBlocksRecursiveMutex) TEST_F(Mutex_test, MutexWithDeadlockDetectionsFailsOnDeadlock) { ::testing::Test::RecordProperty("TEST_ID", "feb07935-674d-4ebc-abaa-66664751719a"); - iox::optional sut; - ASSERT_FALSE( - iox::posix::MutexBuilder().mutexType(iox::posix::MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); + iox::optional sut; + ASSERT_FALSE(MutexBuilder().mutexType(MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); EXPECT_FALSE(sut->lock().has_error()); auto result = sut->lock(); ASSERT_TRUE(result.has_error()); - EXPECT_THAT(result.error(), Eq(iox::posix::MutexLockError::DEADLOCK_CONDITION)); + EXPECT_THAT(result.error(), Eq(MutexLockError::DEADLOCK_CONDITION)); EXPECT_FALSE(sut->unlock().has_error()); } @@ -190,29 +188,27 @@ TEST_F(Mutex_test, MutexWithDeadlockDetectionsFailsOnDeadlock) TEST_F(Mutex_test, MutexWithDeadlockDetectionsFailsWhenSameThreadTriesToUnlockItTwice) { ::testing::Test::RecordProperty("TEST_ID", "062e411e-a5d3-4759-9faf-db6f4129d395"); - iox::optional sut; - ASSERT_FALSE( - iox::posix::MutexBuilder().mutexType(iox::posix::MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); + iox::optional sut; + ASSERT_FALSE(MutexBuilder().mutexType(MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); EXPECT_FALSE(sut->lock().has_error()); EXPECT_FALSE(sut->unlock().has_error()); auto result = sut->unlock(); ASSERT_TRUE(result.has_error()); - EXPECT_THAT(result.error(), Eq(iox::posix::MutexUnlockError::NOT_OWNED_BY_THREAD)); + EXPECT_THAT(result.error(), Eq(MutexUnlockError::NOT_OWNED_BY_THREAD)); } TEST_F(Mutex_test, MutexWithDeadlockDetectionsFailsWhenAnotherThreadTriesToUnlock) { ::testing::Test::RecordProperty("TEST_ID", "4dcea981-2259-48c6-bf27-7839ad9013b4"); - iox::optional sut; - ASSERT_FALSE( - iox::posix::MutexBuilder().mutexType(iox::posix::MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); + iox::optional sut; + ASSERT_FALSE(MutexBuilder().mutexType(MutexType::WITH_DEADLOCK_DETECTION).create(sut).has_error()); EXPECT_FALSE(sut->lock().has_error()); std::thread t([&] { auto result = sut->unlock(); ASSERT_TRUE(result.has_error()); - EXPECT_THAT(result.error(), Eq(iox::posix::MutexUnlockError::NOT_OWNED_BY_THREAD)); + EXPECT_THAT(result.error(), Eq(MutexUnlockError::NOT_OWNED_BY_THREAD)); }); t.join(); EXPECT_FALSE(sut->unlock().has_error()); @@ -226,9 +222,9 @@ TEST_F(Mutex_test, #if defined(QNX) || defined(__QNX) || defined(__QNX__) || defined(QNX__) GTEST_SKIP() << "iox-#1683 QNX supports robust mutex not like the posix standard describes them."; #endif - iox::optional sut; - ASSERT_FALSE(iox::posix::MutexBuilder() - .threadTerminationBehavior(iox::posix::MutexThreadTerminationBehavior::RELEASE_WHEN_LOCKED) + iox::optional sut; + ASSERT_FALSE(MutexBuilder() + .threadTerminationBehavior(MutexThreadTerminationBehavior::RELEASE_WHEN_LOCKED) .create(sut) .has_error()); @@ -237,8 +233,7 @@ TEST_F(Mutex_test, auto result = sut->try_lock(); ASSERT_TRUE(result.has_error()); - EXPECT_THAT(result.error(), - iox::posix::MutexTryLockError::LOCK_ACQUIRED_BUT_HAS_INCONSISTENT_STATE_SINCE_OWNER_DIED); + EXPECT_THAT(result.error(), MutexTryLockError::LOCK_ACQUIRED_BUT_HAS_INCONSISTENT_STATE_SINCE_OWNER_DIED); sut->make_consistent(); EXPECT_FALSE(sut->unlock().has_error()); } @@ -250,9 +245,9 @@ TEST_F(Mutex_test, MutexWithStallWhenLockedBehaviorDoesntUnlockMutexWhenThreadTe #if defined(QNX) || defined(__QNX) || defined(__QNX__) || defined(QNX__) GTEST_SKIP() << "iox-#1683 QNX supports robust mutex not like the posix standard describes them."; #endif - iox::optional sut; - ASSERT_FALSE(iox::posix::MutexBuilder() - .threadTerminationBehavior(iox::posix::MutexThreadTerminationBehavior::STALL_WHEN_LOCKED) + iox::optional sut; + ASSERT_FALSE(MutexBuilder() + .threadTerminationBehavior(MutexThreadTerminationBehavior::STALL_WHEN_LOCKED) .create(sut) .has_error()); @@ -261,7 +256,7 @@ TEST_F(Mutex_test, MutexWithStallWhenLockedBehaviorDoesntUnlockMutexWhenThreadTe auto result = sut->try_lock(); ASSERT_FALSE(result.has_error()); - EXPECT_THAT(*result, iox::posix::MutexTryLock::FAILED_TO_ACQUIRE_LOCK); + EXPECT_THAT(*result, MutexTryLock::FAILED_TO_ACQUIRE_LOCK); } #endif #endif @@ -269,9 +264,9 @@ TEST_F(Mutex_test, MutexWithStallWhenLockedBehaviorDoesntUnlockMutexWhenThreadTe TEST_F(Mutex_test, InitializingMutexTwiceResultsInError) { ::testing::Test::RecordProperty("TEST_ID", "2f26c05f-08e5-481f-8a6e-2ceca3067cf0"); - auto result = iox::posix::MutexBuilder().create(sutRecursive); + auto result = MutexBuilder().create(sutRecursive); ASSERT_THAT(result.has_error(), Eq(true)); - EXPECT_THAT(result.error(), Eq(iox::posix::MutexCreationError::MUTEX_ALREADY_INITIALIZED)); + EXPECT_THAT(result.error(), Eq(MutexCreationError::MUTEX_ALREADY_INITIALIZED)); } } // namespace diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp index 0d5ea3dd14..4395f22f4b 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp @@ -17,13 +17,13 @@ #ifndef IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_DISTRIBUTOR_DATA_HPP #define IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_DISTRIBUTOR_DATA_HPP -#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" #include "iceoryx_posh/internal/mepoo/shm_safe_unmanaged_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_pusher.hpp" #include "iceoryx_posh/popo/port_queue_policies.hpp" #include "iox/algorithm.hpp" #include "iox/logging.hpp" +#include "iox/mutex.hpp" #include "iox/relative_pointer.hpp" #include "iox/vector.hpp" diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp index 214e0ad1d6..973662da1a 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp @@ -16,7 +16,7 @@ #ifndef IOX_POSH_POPO_BUILDING_BLOCKS_LOCKING_POLICY_HPP #define IOX_POSH_POPO_BUILDING_BLOCKS_LOCKING_POLICY_HPP -#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" +#include "iox/mutex.hpp" namespace iox { @@ -33,7 +33,7 @@ class ThreadSafePolicy bool tryLock() const noexcept; private: - mutable optional m_mutex; + mutable optional m_mutex; }; class SingleThreadedPolicy diff --git a/iceoryx_posh/include/iceoryx_posh/internal/runtime/posh_runtime_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/runtime/posh_runtime_impl.hpp index 520cfe6b7d..55f2606172 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/runtime/posh_runtime_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/runtime/posh_runtime_impl.hpp @@ -18,11 +18,11 @@ #define IOX_POSH_RUNTIME_POSH_RUNTIME_IMPL_HPP #include "iceoryx_hoofs/internal/concurrent/periodic_task.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/mutex.hpp" #include "iceoryx_posh/internal/runtime/heartbeat.hpp" #include "iceoryx_posh/internal/runtime/shared_memory_user.hpp" #include "iceoryx_posh/runtime/posh_runtime.hpp" #include "iox/function.hpp" +#include "iox/mutex.hpp" #include "iox/optional.hpp" namespace iox @@ -106,7 +106,7 @@ class PoshRuntimeImpl : public PoshRuntime expected requestConditionVariableFromRoudi(const IpcMessage& sendBuffer) noexcept; - mutable optional m_appIpcRequestMutex; + mutable optional m_appIpcRequestMutex; IpcRuntimeInterface m_ipcChannelInterface; optional m_ShmInterface; diff --git a/iceoryx_posh/source/popo/building_blocks/locking_policy.cpp b/iceoryx_posh/source/popo/building_blocks/locking_policy.cpp index 054ded0f73..dee11d8718 100644 --- a/iceoryx_posh/source/popo/building_blocks/locking_policy.cpp +++ b/iceoryx_posh/source/popo/building_blocks/locking_policy.cpp @@ -25,9 +25,9 @@ namespace popo { ThreadSafePolicy::ThreadSafePolicy() noexcept { - posix::MutexBuilder() + MutexBuilder() .isInterProcessCapable(true) - .mutexType(posix::MutexType::RECURSIVE) + .mutexType(MutexType::RECURSIVE) .create(m_mutex) .expect("Failed to create Mutex"); } @@ -61,7 +61,7 @@ bool ThreadSafePolicy::tryLock() const noexcept { errorHandler(PoshError::POPO__CHUNK_TRY_LOCK_ERROR, ErrorLevel::FATAL); } - return *tryLockResult == posix::MutexTryLock::LOCK_SUCCEEDED; + return *tryLockResult == MutexTryLock::LOCK_SUCCEEDED; } void SingleThreadedPolicy::lock() const noexcept diff --git a/iceoryx_posh/source/runtime/posh_runtime_impl.cpp b/iceoryx_posh/source/runtime/posh_runtime_impl.cpp index cad255ed29..b029657c79 100644 --- a/iceoryx_posh/source/runtime/posh_runtime_impl.cpp +++ b/iceoryx_posh/source/runtime/posh_runtime_impl.cpp @@ -45,9 +45,9 @@ PoshRuntimeImpl::PoshRuntimeImpl(optional name, const Runt m_ipcChannelInterface.getSegmentManagerAddressOffset()}); }()) { - posix::MutexBuilder() + MutexBuilder() .isInterProcessCapable(false) - .mutexType(posix::MutexType::NORMAL) + .mutexType(MutexType::NORMAL) .create(m_appIpcRequestMutex) .expect("Failed to create Mutex"); @@ -684,7 +684,7 @@ popo::ConditionVariableData* PoshRuntimeImpl::getMiddlewareConditionVariable() n bool PoshRuntimeImpl::sendRequestToRouDi(const IpcMessage& msg, IpcMessage& answer) noexcept { // runtime must be thread safe - std::lock_guard g(m_appIpcRequestMutex.value()); + std::lock_guard g(m_appIpcRequestMutex.value()); return m_ipcChannelInterface.sendRequestToRouDi(msg, answer); } diff --git a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp index 90cb53be90..92cfc4c01e 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp @@ -35,7 +35,6 @@ using namespace ::testing; using namespace iox::popo; using namespace iox::cxx; using namespace iox::mepoo; -using namespace iox::posix; struct DummySample { diff --git a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp index c05f2b1db8..b87068c25e 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp @@ -40,7 +40,6 @@ using namespace iox::capro; using namespace iox::cxx; using namespace iox; using namespace iox::mepoo; -using namespace iox::posix; struct DummySample {