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 680121 - g_cancellable_source_new: don't use a file descriptor
g_cancellable_source_new: don't use a file descriptor
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 658763 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-07-17 17:19 UTC by Dan Winship
Modified: 2017-10-24 11:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_cancellable_source_new: don't use a file descriptor (2.23 KB, patch)
2012-07-17 17:19 UTC, Dan Winship
committed Details | Review

Description Dan Winship 2012-07-17 17:19:38 UTC
Rather than implementing GCancellableSource by polling on its fd,
implement it by just waking its GMainContext up from the "cancelled"
signal handler, thereby helping to reduce file descriptor usage.
Suggested by Ryan Lortie.
Comment 1 Dan Winship 2012-07-17 17:19:39 UTC
Created attachment 219041 [details] [review]
g_cancellable_source_new: don't use a file descriptor
Comment 2 Allison Karlitskaya (desrt) 2012-07-17 18:23:49 UTC
Review of attachment 219041 [details] [review]:

This looks pretty great.

I tend to avoid using disconnect_by_id() these days since it's totally pointless -- disconenct_by_func() is easier and just as fast.  Your call if you feel like changing that...
Comment 3 Dan Winship 2012-07-17 19:33:31 UTC
updated to use g_signal_handlers_disconnect_by_func()

Attachment 219041 [details] pushed as 09c1853 - g_cancellable_source_new: don't use a file descriptor
Comment 4 Philip Withnall 2017-10-24 11:34:15 UTC
*** Bug 658763 has been marked as a duplicate of this bug. ***