summaryrefslogtreecommitdiff
path: root/gmain.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-02-22 15:39:57 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-02-22 15:39:57 +0000
commit53be713583cf00b61da8d67348a664e2ec970ddc (patch)
tree7973bb164faf4828eb7a231a710a58937da36dc8 /gmain.c
parentf3ec41e8d22b5fa99b93ea753acb0de873732e94 (diff)
downloadglib-53be713583cf00b61da8d67348a664e2ec970ddc.tar.gz
Add missing implementation ofsource->priority, g_source_remove_poll.
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com> * gmain.c (g_source_remove_poll): Add missing implementation ofsource->priority, g_source_remove_poll. (Pointed out by Stefan Westerfeld)
Diffstat (limited to 'gmain.c')
-rw-r--r--gmain.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/gmain.c b/gmain.c
index b4db4d241..6435a15ce 100644
--- a/gmain.c
+++ b/gmain.c
@@ -896,12 +896,12 @@ g_source_get_context (GSource *source)
}
/**
- * g_main_source_add_poll:
+ * g_source_add_poll:
* @source:a #GSource
* @fd: a #GPollFD structure holding information about a file
* descriptor to watch.
*
- * Add a file descriptor to the set of file descriptors polled * for
+ * Add a file descriptor to the set of file descriptors polled for
* this source. This is usually combined with g_source_new() to add an
* event source. The event source's check function will typically test
* the revents field in the #GPollFD struct and return %TRUE if events need
@@ -932,6 +932,38 @@ g_source_add_poll (GSource *source,
}
/**
+ * g_source_remove_poll:
+ * @source:a #GSource
+ * @fd: a #GPollFD structure previously passed to g_source_poll.
+ *
+ * Remove a file descriptor from the set of file descriptors polled for
+ * this source.
+ **/
+void
+g_source_remove_poll (GSource *source,
+ GPollFD *fd)
+{
+ GMainContext *context;
+
+ g_return_if_fail (source != NULL);
+ g_return_if_fail (fd != NULL);
+ g_return_if_fail (!SOURCE_DESTROYED (source));
+
+ context = source->context;
+
+ if (context)
+ LOCK_CONTEXT (context);
+
+ source->poll_fds = g_slist_remove (source->poll_fds, fd);
+
+ if (context)
+ {
+ g_main_context_remove_poll_unlocked (context, fd);
+ UNLOCK_CONTEXT (context);
+ }
+}
+
+/**
* g_source_set_callback_indirect:
* @source: the source
* @callback_data: pointer to callback data "object"