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 741716 - add simple polling helpers for GCancellable
add simple polling helpers for GCancellable
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-12-18 13:07 UTC by Allison Karlitskaya (desrt)
Modified: 2018-05-24 17:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GCancellable: add new poll wrapper APIs (9.70 KB, patch)
2014-12-18 13:07 UTC, Allison Karlitskaya (desrt)
none Details | Review
gio: use new g_cancellable_poll_simple() API (9.51 KB, patch)
2014-12-18 13:07 UTC, Allison Karlitskaya (desrt)
none Details | Review

Description Allison Karlitskaya (desrt) 2014-12-18 13:07:18 UTC
See patches.
Comment 1 Allison Karlitskaya (desrt) 2014-12-18 13:07:20 UTC
Created attachment 292980 [details] [review]
GCancellable: add new poll wrapper APIs

Add two APIs to GCancellable for waiting on one or more GPollFD records until
they are ready, or until cancellation.

This is basically a cancellable version of g_poll().

This makes many typical operations easier; it will be possible to
replace all cases of g_cancellable_make_pollfd() in GIO with just the
simple version of this function, often at a large reduction in lines of
code.  Even better is that in the future, users of this API may be able
to avoid allocating an fd at all.

I'm not sure if it's worth keeping the _full version.
Comment 2 Allison Karlitskaya (desrt) 2014-12-18 13:07:23 UTC
Created attachment 292981 [details] [review]
gio: use new g_cancellable_poll_simple() API

This removes a lot of similar-looking code.

This also means that there is no longer any code inside of GIO that is
handling fds from GCancellable.  That moves us closer to being able to
completely rid ourselves of per-cancellable file descriptors.

Windows parts are completely untested (and not even compiled).
Comment 3 Paolo Borelli 2014-12-19 07:31:47 UTC
(In reply to comment #1)
> I'm not sure if it's worth keeping the _full version.

I'd actually just keep that one since at that point is exactly the same signature as g_poll plus the cancellable. Also I'd maybe simply call it g_poll_full or g_poll_cancellable (with cancellable being the last param), so that it is in the "g_poll namespace" and not in the "g_cancellable namespace"
Comment 4 GNOME Infrastructure Team 2018-05-24 17:21:09 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/975.