After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631727 - async ready callback is called before entry-parsed signals are emitted
async ready callback is called before entry-parsed signals are emitted
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks:
 
 
Reported: 2010-10-09 05:58 UTC by Jonathan Matthew
Modified: 2010-10-09 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
specify priority in CALL_ASYNC macro (1.15 KB, patch)
2010-10-09 06:00 UTC, Jonathan Matthew
committed Details | Review

Description Jonathan Matthew 2010-10-09 05:58:59 UTC
Looking at using totem_pl_parser_parse_async in rhythmbox, I'm finding that my async ready callback gets called before my entry-parsed signal handler, which seems counterintuitive to me and makes it harder to use than I'd like.

This appears to be because the mainloop source used for the async ready callback has G_PRIORITY_DEFAULT priority while the idle sources used to emit signals have G_PRIORITY_DEFAULT_IDLE, so if the mainloop is busy, it'll run them in priority order rather than the order they're created, as it would if the mainloop was idle.

Changing the CALL_ASYNC macro in totem-pl-parser-private.h to specify G_PRIORITY_DEFAULT seems to fix it for me.
Comment 1 Jonathan Matthew 2010-10-09 06:00:35 UTC
Created attachment 171988 [details] [review]
specify priority in CALL_ASYNC macro
Comment 2 Philip Withnall 2010-10-09 13:43:05 UTC
Looks good, please add a comment mentioning why the priority is specified, and commit. Thanks.
Comment 3 Jonathan Matthew 2010-10-09 21:29:20 UTC
pushed as commit 6792ae8