aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-02-03 18:02:01 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-02-03 18:02:01 +0400
commitb5f2b43a8d1fc3361dc1665c62b2a44d66c01474 (patch)
tree331933a013a77f5da97e752655ae6be0c278646b /src
parent5c0f36dfe734e46d72e4afdfd71c05353e4df86d (diff)
downloadrspamd-b5f2b43a8d1fc3361dc1665c62b2a44d66c01474.tar.gz
rspamd-b5f2b43a8d1fc3361dc1665c62b2a44d66c01474.zip
Fix build with glib <= 2.30.
Diffstat (limited to 'src')
-rw-r--r--src/events.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/events.c b/src/events.c
index 0daefc95f..98b492ffb 100644
--- a/src/events.c
+++ b/src/events.c
@@ -48,6 +48,16 @@ rspamd_event_hash (gconstpointer a)
return GPOINTER_TO_UINT (ev->user_data);
}
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+static void
+event_mutex_free (gpointer data)
+{
+ GMutex *mtx = data;
+
+ g_mutex_free (mtx);
+}
+#endif
+
struct rspamd_async_session *
new_async_session (memory_pool_t * pool, event_finalizer_t fin,
event_finalizer_t restore, event_finalizer_t cleanup, void *user_data)
@@ -64,7 +74,7 @@ new_async_session (memory_pool_t * pool, event_finalizer_t fin,
new->events = g_hash_table_new (rspamd_event_hash, rspamd_event_equal);
#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
new->mtx = g_mutex_new ();
- memory_pool_add_destructor (pool, (pool_destruct_func) g_mutex_free, new->mtx);
+ memory_pool_add_destructor (pool, (pool_destruct_func) event_mutex_free, new->mtx);
#else
new->mtx = memory_pool_alloc (pool, sizeof (GMutex));
g_mutex_init (new->mtx);