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

[Android] Replace custom StackLock with platform lock #10203

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

austinh0
Copy link
Contributor

@austinh0 austinh0 commented Oct 4, 2021

Problem

After #9884, Android is using the platform event loop in GenericPlatformManagerImpl_POSIX, which uses the platform lock. However, Android is still using its own custom lock, which results in deadlocks.

Change overview

  • Switch to using platform lock:
    • Remove Android-only StackLock.h and custom JniReferences::GetInstance().GetStackLock().
    • Replace StackLockGuard with chip::DeviceLayer::StackLock, and StackUnlockGuard with newly created chip::DeviceLayer::StackUnlock

Testing

  • Commissioned and controlled device using Android CHIPTool.

@austinh0 austinh0 changed the title [Android Replace custom StackLock with platform lock [Android] Replace custom StackLock with platform lock Oct 4, 2021
Copy link
Contributor

@msandstedt msandstedt left a comment

Choose a reason for hiding this comment

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

PR breaks POSX::_InitChipStack such that reinitialization of chip stack does not initialize the stack lock.

@austinh0
Copy link
Contributor Author

austinh0 commented Oct 5, 2021

@austinh0 austinh0 merged commit 8788f6f into project-chip:master Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants