Skip to content

Commit

Permalink
iox-eclipse-iceoryx#484 remove the thread usage for the posix lock mu…
Browse files Browse the repository at this point in the history
…tex test

Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <Sankara.Narayanan@in.bosch.com>
  • Loading branch information
shankar-in authored and Chari Nehal Dattaram (RBEI/EBB1) committed Feb 8, 2021
1 parent db2370a commit 317d4e5
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions iceoryx_utils/test/moduletests/test_posix_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,8 @@ TEST_F(Mutex_test, DestructorFailsOnLockedMutex)

EXPECT_DEATH(
{
std::thread* t;
{
iox::posix::mutex mtx{false};
constexpr iox::units::Duration mutexTimerDuration = 1000_ms;
constexpr iox::units::Duration threadTimerDuration = 5000_ms;
iox::cxx::DeadlineTimer mutexTimer(mutexTimerDuration);

t = new std::thread([&] {
mtx.lock();
iox::cxx::DeadlineTimer ct(threadTimerDuration);
std::this_thread::sleep_for(std::chrono::milliseconds(2 * threadTimerDuration.milliSeconds()));
});

std::this_thread::sleep_for(std::chrono::milliseconds(2 * mutexTimerDuration.milliSeconds()));
}
t->join();
delete t;
iox::posix::mutex mtx{false};
mtx.lock();
},
".*");

Expand Down

0 comments on commit 317d4e5

Please sign in to comment.