Re: Making PangoCairo threadsafe

On Mon, 20 Nov 2006, Behdad Esfahbod wrote:

Filed a bug for tracking this:

On Mon, 2006-11-20 at 17:05 -0500, Behdad Esfahbod wrote:

All seem like boring but easy fixes, using a few static mutexes.  I have
a question though: For platforms that we care about, are int and pointer
assignments atomic?  Ok, rkaway is telling me that they are not.

and i stand by that ;)

which is why glib provides in gatomic.h:
  gint     g_atomic_int_get                      (volatile gint     *atomic);
  void     g_atomic_int_set                      (volatile gint     *atomic,
                                                  gint               newval);
  gpointer g_atomic_pointer_get                  (volatile gpointer *atomic);
  void     g_atomic_pointer_set                  (volatile gpointer *atomic,
                                                  gpointer           newval);
these provide portable atomic access to int and gpointer.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]