diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-02-13 10:18:03 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2014-02-15 16:57:11 -0500 |
commit | 606ad2867307f4f7148914038f03dcc1f71ab646 (patch) | |
tree | 46ffaf5c863b1ad1c87f71b3a1d10c93715bcb0a | |
parent | 7836fce0cdb476432dff86c4f18dc59109dc2ef5 (diff) | |
download | glib-606ad2867307f4f7148914038f03dcc1f71ab646.tar.gz |
gsource: document priority of child sources
Add a note to the documentation that child sources cannot have their priority
changed independently from their parent. Add a g_return_if_fail() to the
public API in order to enforce this.
This was already a reality due to the check in
g_source_set_priority_unlocked(), but it was never explicitly documented.
-rw-r--r-- | glib/gmain.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glib/gmain.c b/glib/gmain.c index 4e72c1e30..b9e80c9a9 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -1659,6 +1659,10 @@ g_source_set_priority_unlocked (GSource *source, * source will be dispatched if it is ready to be dispatched and no * sources at a higher (numerically smaller) priority are ready to be * dispatched. + * + * A child source always has the same priority as its parent. It is not + * permitted to change the priority of a source once it has been added + * as a child of another source. **/ void g_source_set_priority (GSource *source, @@ -1667,6 +1671,7 @@ g_source_set_priority (GSource *source, GMainContext *context; g_return_if_fail (source != NULL); + g_return_if_fail (source->priv->parent_source == NULL); context = source->context; |