GNOME Bugzilla – Bug 680121
g_cancellable_source_new: don't use a file descriptor
Last modified: 2017-10-24 11:34:15 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.
Created attachment 219041 [details] [review] g_cancellable_source_new: don't use a file descriptor
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...
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
*** Bug 658763 has been marked as a duplicate of this bug. ***