[glib/wip/ghandle: 7/16] gwakeup: add support for ghandle
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/ghandle: 7/16] gwakeup: add support for ghandle
- Date: Fri, 19 Dec 2014 17:25:53 +0000 (UTC)
commit 9e9f2567f10f119c6dad1e7ae0a89ca7543bcd1a
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Dec 18 15:35:49 2014 -0500
gwakeup: add support for ghandle
glib/gwakeup.c | 24 ++++++++++++++++++++++++
glib/gwakeup.h | 1 +
2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/glib/gwakeup.c b/glib/gwakeup.c
index c0f1ba0..44443a5 100644
--- a/glib/gwakeup.c
+++ b/glib/gwakeup.c
@@ -81,6 +81,12 @@ g_wakeup_new (void)
return (GWakeup *) wakeup;
}
+ghandle
+g_wakeup_get_handle (GWakeup *wakeup)
+{
+ return (ghandle) wakeup;
+}
+
void
g_wakeup_get_pollfd (GWakeup *wakeup,
GPollFD *poll_fd)
@@ -168,6 +174,24 @@ g_wakeup_new (void)
}
/**
+ * g_wakeup_get_handle:
+ * @wakeup: a #GWakeup
+ *
+ * Returns the #ghandle for wakeup. The handle will poll as ready when
+ * the wakeup is signalled and will continue to poll as ready until the
+ * wakeup has been acknowledged.
+ *
+ * Returns: a valid #ghandle
+ *
+ * Since: 2.44
+ **/
+ghandle
+g_wakeup_get_handle (GWakeup *wakeup)
+{
+ return wakeup->fds[0];
+}
+
+/**
* g_wakeup_get_pollfd:
* @wakeup: a #GWakeup
* @poll_fd: a #GPollFD
diff --git a/glib/gwakeup.h b/glib/gwakeup.h
index adf415c..70b3a23 100644
--- a/glib/gwakeup.h
+++ b/glib/gwakeup.h
@@ -27,6 +27,7 @@ typedef struct _GWakeup GWakeup;
GWakeup * g_wakeup_new (void);
void g_wakeup_free (GWakeup *wakeup);
+ghandle g_wakeup_get_handle (GWakeup *wakeup);
void g_wakeup_get_pollfd (GWakeup *wakeup,
GPollFD *poll_fd);
void g_wakeup_signal (GWakeup *wakeup);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]