-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Linux] Run functions on GLib event loop in a sync way #25916
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PR #25916: Size comparison from ce0ddc0 to a88f22e Full report (1 build for cc32xx)
|
PR #25916: Size comparison from ce0ddc0 to 40811c4 Increases (10 builds for bl602, bl702, cc32xx, k32w, linux, nrfconnect, psoc6)
Decreases (6 builds for efr32, linux, nrfconnect, psoc6, qpg)
Full report (34 builds for bl602, bl702, cc13x2_26x2, cc32xx, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, qpg)
|
PR #25916: Size comparison from ce0ddc0 to 95eb311 Decreases (1 build for cc32xx)
Full report (1 build for cc32xx)
|
PR #25916: Size comparison from bf6dc7b to af69485 Increases (3 builds for linux, qpg)
Decreases (7 builds for bl602, bl702, cc32xx, linux, psoc6)
Full report (23 builds for bl602, bl702, cc32xx, cyw30739, k32w, linux, mbed, nrfconnect, psoc6, qpg)
|
pullapprove
bot
requested review from
amitnj,
anush-apple,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
cliffamzn,
CodeChronos928,
Damian-Nordic,
dhrishi,
electrocucaracha,
emargolis,
franck-apple,
gjc13 and
harimau-qirex
April 3, 2023 20:41
pullapprove
bot
requested review from
lazarkov,
lpbeliveau-silabs,
LuDuda,
mrjerryjohns,
mspang,
nivi-apple,
robszewczyk,
saurabhst,
selissia,
sharadb-amazon,
tcarmelveilleux,
tecimovic,
tehampson,
vijs,
vivien-apple,
woody-apple,
xylophone21,
younghak-hwang,
yufengwangca and
yunhanw-google
April 3, 2023 20:41
The g_main_context_invoke_full() function checks whether the context, on which it's supposed to run callback function, is acquired. Otherwise, it runs given callback on the current thread. In our case this may lead to incorrect GLib signals bindings, so we have to use g_source_attach() when waiting for main loop.
TSAN can report false-positive on context unref. By firstly joining thread and later unreferencing context we will prevent such warning.
PR #25916: Size comparison from d81d4e3 to 523b369 Decreases (1 build for cc32xx)
Full report (1 build for cc32xx)
|
andy31415
approved these changes
Apr 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
It's not possible to easily retrieve error from callback function passed to the
RunOnGLibMainLoopThread()
function.This PR is a first step for using Matter dedicated GLib context in GLib event loop thread instead of global main context (using global main context causes issues with using Matter SDK with Qt framework on Linux).
Changes
RunOnGLibMainLoopThread
synchronous in all cases (if one want's async processing there is theScheduleWork()
function) and forward the callbacks's return value to the callerScheduleOnGLibMainLoopThread
toGLibMatterContextInvokeSync
so the name will be more descriptiveTesting
Tested BLE commissioning with