Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-#33 posix mutex support in windows #797

Merged
merged 11 commits into from
May 20, 2021

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented May 17, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #797 (f812379) into master (92f5bde) will decrease coverage by 0.04%.
The diff coverage is 83.33%.

❗ Current head f812379 differs from pull request most recent head 5bbfb72. Consider uploading reports for the commit 5bbfb72 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #797      +/-   ##
==========================================
- Coverage   74.41%   74.36%   -0.05%     
==========================================
  Files         322      322              
  Lines       11522    11533      +11     
  Branches     1952     1956       +4     
==========================================
+ Hits         8574     8577       +3     
- Misses       2190     2193       +3     
- Partials      758      763       +5     
Flag Coverage Δ
unittests 73.21% <83.33%> (-0.03%) ⬇️
unittests_timing 30.92% <41.66%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
iceoryx_hoofs/source/posix_wrapper/mutex.cpp 81.25% <33.33%> (-5.42%) ⬇️
...ceoryx_hoofs/internal/posix_wrapper/posix_call.inl 100.00% <100.00%> (ø)
iceoryx_hoofs/source/concurrent/loffli.cpp 79.41% <0.00%> (-5.89%) ⬇️
iceoryx_hoofs/source/posix_wrapper/timer.cpp 60.60% <0.00%> (-0.87%) ⬇️
...nternal/roudi/introspection/port_introspection.inl 71.89% <0.00%> (-0.73%) ⬇️

@elfenpiff elfenpiff requested review from mossmaurice and dkroenke May 17, 2021 17:30
@elfenpiff elfenpiff marked this pull request as ready for review May 17, 2021 17:30
@elfenpiff elfenpiff requested a review from elBoberido May 18, 2021 10:31
.github/workflows/build-test.yml Outdated Show resolved Hide resolved
iceoryx_examples/waitset/ice_waitset_basic.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/cmake/IceoryxPlatform.cmake Outdated Show resolved Hide resolved
iceoryx_hoofs/platform/win/source/semaphore.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/cmake/IceoryxPlatform.cmake Outdated Show resolved Hide resolved
iceoryx_hoofs/source/posix_wrapper/mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_posix_mutex.cpp Outdated Show resolved Hide resolved
@elfenpiff elfenpiff requested a review from elBoberido May 19, 2021 19:45
elfenpiff and others added 11 commits May 20, 2021 12:17
…accordingly, fixed issue where the wrong errno was set in windows platform semaphore

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…posixCall assigns returnValue to errnum if it contains errno

Signed-off-by: Christian Eltzschig <me@elchris.org>
…six call

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…ting time < 1, linking error fix in mutex posix

Signed-off-by: Christian Eltzschig <me@elchris.org>
…ility of code, steady clock instead high resolution clock (since it is not the same on all platforms), added missing posix call tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
@elfenpiff elfenpiff force-pushed the iox-#33-recursive-mutex branch from f812379 to 5bbfb72 Compare May 20, 2021 10:17
@@ -34,7 +34,7 @@ class Mutex_test : public Test
void SetUp() override
{
internal::CaptureStderr();
m_deadlockWatchdog.watchAndActOnFailure([] { std::terminate(); });
deadlockWatchdog.watchAndActOnFailure([] { std::terminate(); });
Copy link
Contributor

@MatthiasKillat MatthiasKillat May 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also ASSERT_TRUE(false) here instead of terminate. I have not tested how it behaves when called from another thread (like here in the watchdog) but maybe it would be possible to abort the current test this way with a failure and still run the next test (to get more info on what is broken).

If this does not work I see no easy way to abort only the current test (which is considered blocked).

Èdit: ASSERT_TRUE is a crude way of doing this, better use FAIL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert just return and does not unblock the deadlock

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.We could in theory still do this in another way by essentially creating a NO_DEATH test which under normal conditions expects not to terminate but can terminated like here due to timeout. I did something like this some time ago (not with timeout) in the C binding with an invalid options test case, Gtest has the necessary macro infrastructure.

This would work (I think) because those are forked and if we terminate the forked test it would fail and a blocked mutex is of no concern since thre process is terminated anyway.

But it is not worth it to do so, I just think it is possible in principle.

@@ -7,7 +7,8 @@ CheckOptions:
- { key: readability-identifier-naming.MethodCase, value: camelBack }
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.MemberPrefix, value: m_ }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To which clang-tidy version refers this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkroenke This should be available in clang-tidy 10, see: https://releases.llvm.org/10.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-identifier-naming.html

At the moment I would not yet enforce this clang-tidy file since needs to mature a little while longer. But I strongly suggest that we all integrate clang-tidy into our IDE so that this file can mature faster.

@elfenpiff elfenpiff merged commit d3f697f into eclipse-iceoryx:master May 20, 2021
@elfenpiff elfenpiff deleted the iox-#33-recursive-mutex branch May 20, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic Windows 10 support
5 participants