mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-28 06:56:16 +01:00
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. https://bugzilla.gnome.org/show_bug.cgi?id=724706
This commit is contained in:
parent
8491f03581
commit
0415930b49
@ -1706,6 +1706,10 @@ g_source_set_priority_unlocked (GSource *source,
|
|||||||
* source will be dispatched if it is ready to be dispatched and no
|
* source will be dispatched if it is ready to be dispatched and no
|
||||||
* sources at a higher (numerically smaller) priority are ready to be
|
* sources at a higher (numerically smaller) priority are ready to be
|
||||||
* dispatched.
|
* 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
|
void
|
||||||
g_source_set_priority (GSource *source,
|
g_source_set_priority (GSource *source,
|
||||||
@ -1714,6 +1718,7 @@ g_source_set_priority (GSource *source,
|
|||||||
GMainContext *context;
|
GMainContext *context;
|
||||||
|
|
||||||
g_return_if_fail (source != NULL);
|
g_return_if_fail (source != NULL);
|
||||||
|
g_return_if_fail (source->priv->parent_source == NULL);
|
||||||
|
|
||||||
context = source->context;
|
context = source->context;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user