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

[cli] fix signal handling #138

Merged
merged 2 commits into from
Jul 28, 2020
Merged

Conversation

wgtdkp
Copy link
Member

@wgtdkp wgtdkp commented Jul 26, 2020

Synchronization primitives (std::mutex, std::future) in namespace std are used to synchronize calls to the commissioner API. Unfortunately, those synchronization primitives are not signal-safe and will result in deadlock.

This PR fixes this by using a dedicated thread to wait for the signal.

@wgtdkp wgtdkp requested a review from simonlingoogle July 26, 2020 06:41
@wgtdkp wgtdkp added the bug Something isn't working label Jul 26, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2020

Codecov Report

Merging #138 into master will increase coverage by 0.05%.
The diff coverage is 90.90%.

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
+ Coverage   64.77%   64.82%   +0.05%     
==========================================
  Files          52       52              
  Lines        4749     4754       +5     
==========================================
+ Hits         3076     3082       +6     
+ Misses       1673     1672       -1     
Impacted Files Coverage Δ
src/app/cli/main.cpp 93.75% <90.90%> (+4.86%) ⬆️

Copy link
Member

@simonlingoogle simonlingoogle left a comment

Choose a reason for hiding this comment

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

LGTM 👍
with a small suggestion

@wgtdkp wgtdkp requested a review from jwhui July 27, 2020 02:51
src/app/cli/main.cpp Outdated Show resolved Hide resolved
@jwhui
Copy link
Member

jwhui commented Jul 27, 2020

@wgtdkp , please help resolve conflicts.

# Conflicts:
resolve conflicts
@wgtdkp
Copy link
Member Author

wgtdkp commented Jul 28, 2020

@jwhui done.

@jwhui jwhui merged commit b25e68c into openthread:master Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants