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

[sensorfwd] Transfer events from worker threads via pipe #24

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

spiiroin
Copy link
Contributor

@spiiroin spiiroin commented Feb 6, 2024

No description provided.

core/hybrisadaptor.cpp Outdated Show resolved Hide resolved
core/hybrisadaptor.cpp Outdated Show resolved Hide resolved
Non-reentrant method HybrisManager::processSample() is used directly
from hal worker thread. This can lead to heap corruption and crashes.

Use pipe and io-watch for transferring sensor events from worker
thread to mainloop context and thus avoid the reentrancy issues
by having sensor chain data management happen only in one thread.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
Number of events to ask from android hal/service should agree
with number of events to transfer over event pipe in one go.
Which they do at the moment, but using separately defined
hard coded values.

Use common maxEvents = 64 constant for both transfer sizes
within sensorfwd and from android hal/service.

Also harmonize naming of event count variables and parameters.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
@spiiroin spiiroin merged commit e7742a6 into sailfishos:master Feb 8, 2024
@spiiroin spiiroin deleted the jb60382_event_pipe branch February 9, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants