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>
|
2007-09-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* configure.in: Replace -pthread by -lpthread for
|
* configure.in: Replace -pthread by -lpthread for
|
||||||
|
28
glib/gmain.c
28
glib/gmain.c
@ -1747,8 +1747,6 @@ get_dispatch (void)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* g_main_depth:
|
* g_main_depth:
|
||||||
*
|
|
||||||
* Return value: The main loop recursion level in the current thread
|
|
||||||
*
|
*
|
||||||
* Returns the depth of the stack of calls to
|
* Returns the depth of the stack of calls to
|
||||||
* g_main_context_dispatch() on any #GMainContext in the current thread.
|
* g_main_context_dispatch() on any #GMainContext in the current thread.
|
||||||
@ -1761,9 +1759,9 @@ get_dispatch (void)
|
|||||||
* This function is useful in a situation like the following:
|
* This function is useful in a situation like the following:
|
||||||
* Imagine an extremely simple "garbage collected" system.
|
* Imagine an extremely simple "garbage collected" system.
|
||||||
*
|
*
|
||||||
* <example>
|
* |[
|
||||||
* static GList *free_list;
|
* static GList *free_list;
|
||||||
*
|
*
|
||||||
* gpointer
|
* gpointer
|
||||||
* allocate_memory (gsize size)
|
* allocate_memory (gsize size)
|
||||||
* {
|
* {
|
||||||
@ -1771,7 +1769,7 @@ get_dispatch (void)
|
|||||||
* free_list = g_list_prepend (free_list, result);
|
* free_list = g_list_prepend (free_list, result);
|
||||||
* return result;
|
* return result;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* free_allocated_memory (void)
|
* free_allocated_memory (void)
|
||||||
* {
|
* {
|
||||||
@ -1781,15 +1779,15 @@ get_dispatch (void)
|
|||||||
* g_list_free (free_list);
|
* g_list_free (free_list);
|
||||||
* free_list = NULL;
|
* free_list = NULL;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* [...]
|
* [...]
|
||||||
*
|
*
|
||||||
* while (TRUE);
|
* while (TRUE);
|
||||||
* {
|
* {
|
||||||
* g_main_context_iteration (NULL, TRUE);
|
* g_main_context_iteration (NULL, TRUE);
|
||||||
* free_allocated_memory();
|
* free_allocated_memory();
|
||||||
* }
|
* }
|
||||||
* </example>
|
* ]|
|
||||||
*
|
*
|
||||||
* This works from an application, however, if you want to do the same
|
* 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
|
* thing from a library, it gets more difficult, since you no longer
|
||||||
@ -1798,22 +1796,22 @@ get_dispatch (void)
|
|||||||
* doesn't work, since the idle function could be called from a
|
* doesn't work, since the idle function could be called from a
|
||||||
* recursive callback. This can be fixed by using g_main_depth()
|
* recursive callback. This can be fixed by using g_main_depth()
|
||||||
*
|
*
|
||||||
* <example>
|
* |[
|
||||||
* gpointer
|
* gpointer
|
||||||
* allocate_memory (gsize size)
|
* allocate_memory (gsize size)
|
||||||
* {
|
* {
|
||||||
* FreeListBlock *block = g_new (FreeListBlock, 1);\
|
* FreeListBlock *block = g_new (FreeListBlock, 1);
|
||||||
* block->mem = g_malloc (size);
|
* block->mem = g_malloc (size);
|
||||||
* block->depth = g_main_depth ();
|
* block->depth = g_main_depth ();
|
||||||
* free_list = g_list_prepend (free_list, block);
|
* free_list = g_list_prepend (free_list, block);
|
||||||
* return block->mem;
|
* return block->mem;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* void
|
* void
|
||||||
* free_allocated_memory (void)
|
* free_allocated_memory (void)
|
||||||
* {
|
* {
|
||||||
* GList *l;
|
* GList *l;
|
||||||
*
|
*
|
||||||
* int depth = g_main_depth ();
|
* int depth = g_main_depth ();
|
||||||
* for (l = free_list; l; );
|
* for (l = free_list; l; );
|
||||||
* {
|
* {
|
||||||
@ -1825,11 +1823,11 @@ get_dispatch (void)
|
|||||||
* g_free (block);
|
* g_free (block);
|
||||||
* free_list = g_list_delete_link (free_list, l);
|
* free_list = g_list_delete_link (free_list, l);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* l = next;
|
* l = next;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </example>
|
* ]|
|
||||||
*
|
*
|
||||||
* There is a temptation to use g_main_depth() to solve
|
* There is a temptation to use g_main_depth() to solve
|
||||||
* problems with reentrancy. For instance, while waiting for data
|
* problems with reentrancy. For instance, while waiting for data
|
||||||
@ -1860,6 +1858,8 @@ get_dispatch (void)
|
|||||||
* </para>
|
* </para>
|
||||||
* </listitem>
|
* </listitem>
|
||||||
* </orderedlist>
|
* </orderedlist>
|
||||||
|
*
|
||||||
|
* Return value: The main loop recursion level in the current thread
|
||||||
**/
|
**/
|
||||||
int
|
int
|
||||||
g_main_depth (void)
|
g_main_depth (void)
|
||||||
|
Loading…
Reference in New Issue
Block a user