+2002-04-18 Matthias Clasen <maclas@gmx.de>
+
+ * glib/tmpl/error_reporting.sgml:
+ * glib/tmpl/threads.sgml:
+ * glib/tmpl/arrays_pointer.sgml:
+ * glib/tmpl/arrays_byte.sgml:
+ * glib/tmpl/memory_chunks.sgml: s/<!>/<!-- -->/g throughout the
+ documentation to bring the produced Docbook closer to XML.
+
2002-03-25 Sven Neumann <sven@gimp.org>
* glib/tmpl/scanner.sgml: Fixed documentation about unused struct
GRealArray *array;
/* Create a GMemChunk to hold GRealArray structures, using the
- g_mem_chunk_create(<!>) convenience macro. We want 1024 atoms in each
+ g_mem_chunk_create(<!-- -->) convenience macro. We want 1024 atoms in each
memory block, and we want to be able to free individual atoms. */
array_mem_chunk = g_mem_chunk_create (GRealArray, 1024, G_ALLOC_AND_FREE);
- /* Allocate one atom, using the g_chunk_new(<!>) convenience macro. */
+ /* Allocate one atom, using the g_chunk_new(<!-- -->) convenience macro. */
array = g_chunk_new (GRealArray, array_mem_chunk);
/* We can now use array just like a normal pointer to a structure. */
<para>
<informalexample>
<programlisting>
-if (!g_thread_supported (<!>)) g_thread_init (NULL);
+if (!g_thread_supported (<!-- -->)) g_thread_init (NULL);
</programlisting>
</informalexample>
</para>
<example>
<title>A function which will not work in a threaded environment</title>
<programlisting>
- int give_me_next_number (<!>)
+ int give_me_next_number (<!-- -->)
{
static int current_number = 0;
<example>
<title>The wrong way to write a thread-safe function</title>
<programlisting>
- int give_me_next_number (<!>)
+ int give_me_next_number (<!-- -->)
{
static int current_number = 0;
int ret_val;
<programlisting>
static GMutex *give_me_next_number_mutex = NULL;
- /* this function must be called before any call to give_me_next_number (<!>)
+ /* this function must be called before any call to give_me_next_number (<!-- -->)
it must be called exactly once. */
- void init_give_me_next_number (<!>)
+ void init_give_me_next_number (<!-- -->)
{
g_assert (give_me_next_number_mutex == NULL);
- give_me_next_number_mutex = g_mutex_new (<!>);
+ give_me_next_number_mutex = g_mutex_new (<!-- -->);
}
- int give_me_next_number (<!>)
+ int give_me_next_number (<!-- -->)
{
static int current_number = 0;
int ret_val;
<example>
<title>Using <structname>GStaticMutex</structname> to simplify thread-safe programming</title>
<programlisting>
- int give_me_next_number (<!>)
+ int give_me_next_number (<!-- -->)
{
static int current_number = 0;
int ret_val;
<programlisting>
G_LOCK_DEFINE (current_number);
-int give_me_next_number (<!>)
+int give_me_next_number (<!-- -->)
{
static int current_number = 0;
int ret_val;
g_static_rw_lock_writer_lock (&rwlock);
if (!array)
- array = g_ptr_array_new ();
+ array = g_ptr_array_new (<!-- -->);
if (index >= array->len)
g_ptr_array_set_size (array, index+1);
g_mutex_unlock (data_mutex);
}
-gpointer pop_data ()
+gpointer pop_data (<!-- -->)
{
gpointer data;
GPrivate* current_number_key = NULL; /* Must be initialized somewhere */
/* with g_private_new (g_free); */
- int give_me_next_number ()
+ int give_me_next_number (<!-- -->)
{
int *current_number = g_private_get (current_number_key);
<example>
<title>Using GStaticPrivate for per-thread data</title>
<programlisting>
- int give_me_next_number ()
+ int give_me_next_number (<!-- -->)
{
static GStaticPrivate current_number_key = G_STATIC_PRIVATE_INIT;
int *current_number = g_static_private_get (&current_number_key);