mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Fix a doc formatting problem
svn path=/trunk/; revision=5766
This commit is contained in:
parent
30e729d9b2
commit
34a9878985
@ -1,3 +1,7 @@
|
||||
2007-09-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/gmain.c (g_main_depth): Fix doc formatting.
|
||||
|
||||
2007-09-16 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* configure.in: Replace -pthread by -lpthread for
|
||||
|
14
glib/gmain.c
14
glib/gmain.c
@ -1748,8 +1748,6 @@ get_dispatch (void)
|
||||
/**
|
||||
* g_main_depth:
|
||||
*
|
||||
* Return value: The main loop recursion level in the current thread
|
||||
*
|
||||
* Returns the depth of the stack of calls to
|
||||
* g_main_context_dispatch() on any #GMainContext in the current thread.
|
||||
* That is, when called from the toplevel, it gives 0. When
|
||||
@ -1761,7 +1759,7 @@ get_dispatch (void)
|
||||
* This function is useful in a situation like the following:
|
||||
* Imagine an extremely simple "garbage collected" system.
|
||||
*
|
||||
* <example>
|
||||
* |[
|
||||
* static GList *free_list;
|
||||
*
|
||||
* gpointer
|
||||
@ -1789,7 +1787,7 @@ get_dispatch (void)
|
||||
* g_main_context_iteration (NULL, TRUE);
|
||||
* free_allocated_memory();
|
||||
* }
|
||||
* </example>
|
||||
* ]|
|
||||
*
|
||||
* This works from an application, however, if you want to do the same
|
||||
* thing from a library, it gets more difficult, since you no longer
|
||||
@ -1798,11 +1796,11 @@ get_dispatch (void)
|
||||
* doesn't work, since the idle function could be called from a
|
||||
* recursive callback. This can be fixed by using g_main_depth()
|
||||
*
|
||||
* <example>
|
||||
* |[
|
||||
* gpointer
|
||||
* allocate_memory (gsize size)
|
||||
* {
|
||||
* FreeListBlock *block = g_new (FreeListBlock, 1);\
|
||||
* FreeListBlock *block = g_new (FreeListBlock, 1);
|
||||
* block->mem = g_malloc (size);
|
||||
* block->depth = g_main_depth ();
|
||||
* free_list = g_list_prepend (free_list, block);
|
||||
@ -1829,7 +1827,7 @@ get_dispatch (void)
|
||||
* l = next;
|
||||
* }
|
||||
* }
|
||||
* </example>
|
||||
* ]|
|
||||
*
|
||||
* There is a temptation to use g_main_depth() to solve
|
||||
* problems with reentrancy. For instance, while waiting for data
|
||||
@ -1860,6 +1858,8 @@ get_dispatch (void)
|
||||
* </para>
|
||||
* </listitem>
|
||||
* </orderedlist>
|
||||
*
|
||||
* Return value: The main loop recursion level in the current thread
|
||||
**/
|
||||
int
|
||||
g_main_depth (void)
|
||||
|
Loading…
Reference in New Issue
Block a user