Changeset cb124fc6


Ignore:
Timestamp:
Oct 29, 2012, 11:04:56 PM (9 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master
Children:
0792d99
Parents:
c748e8a
git-author:
Anders Kaseorg <andersk@mit.edu> (06/26/12 01:57:33)
git-committer:
Anders Kaseorg <andersk@mit.edu> (10/29/12 23:04:56)
Message:
Replace deprecated GLib < 2.31.0 mutex APIs

As of GLib 2.31.0,
 - GMutex and GCond can now be statically allocated without explicit
   initialisation.  Dynamic allocation for these types is deprecated.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rc748e8a rcb124fc6  
    100100
    101101  g->interrupt_count = 0;
     102#if GLIB_CHECK_VERSION(2, 31, 0)
     103  g_mutex_init(&g->interrupt_lock);
     104#else
    102105  g->interrupt_lock = g_mutex_new();
     106#endif
    103107}
    104108
     
    901905static GMutex *owl_global_get_interrupt_lock(owl_global *g)
    902906{
     907#if GLIB_CHECK_VERSION(2, 31, 0)
     908  return &g->interrupt_lock;
     909#else
    903910  return g->interrupt_lock;
     911#endif
    904912}
    905913
  • owl.h

    r219f52c rcb124fc6  
    596596  char *kill_buffer;
    597597  int interrupt_count;
     598#if GLIB_CHECK_VERSION(2, 31, 0)
     599  GMutex interrupt_lock;
     600#else
    598601  GMutex *interrupt_lock;
     602#endif
    599603} owl_global;
    600604
Note: See TracChangeset for help on using the changeset viewer.