From 87d5307b91d733dac7277c28f4b760d4f90a5a4a Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 22 Dec 2012 13:21:20 +0100 Subject: Update for deprecations in GLib * Use GMutex insteod of GStaticMutex * Don't use g_thread_supported --- egg/egg-libgcrypt.c | 3 +-- egg/egg-secure-memory.h | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'egg') diff --git a/egg/egg-libgcrypt.c b/egg/egg-libgcrypt.c index efb7372e..3d8f95bf 100644 --- a/egg/egg-libgcrypt.c +++ b/egg/egg-libgcrypt.c @@ -100,8 +100,7 @@ egg_libgcrypt_initialize (void) /* Only initialize libgcrypt if it hasn't already been initialized */ if (!gcry_control (GCRYCTL_INITIALIZATION_FINISHED_P)) { - if (g_thread_supported()) - gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs); + gcry_control (GCRYCTL_SET_THREAD_CBS, &glib_thread_cbs); gcry_check_version (LIBGCRYPT_VERSION); gcry_set_log_handler (log_handler, NULL); gcry_set_outofcore_handler (no_mem_handler, NULL); diff --git a/egg/egg-secure-memory.h b/egg/egg-secure-memory.h index 969dbd73..51815511 100644 --- a/egg/egg-secure-memory.h +++ b/egg/egg-secure-memory.h @@ -57,11 +57,11 @@ typedef struct { lock, unlock, fallback, NULL, EGG_SECURE_POOL_VER_STR }; #define EGG_SECURE_DEFINE_GLIB_GLOBALS() \ - static GStaticMutex memory_mutex = G_STATIC_MUTEX_INIT; \ + static GMutex memory_mutex = { 0, }; \ static void egg_memory_lock (void) \ - { g_static_mutex_lock (&memory_mutex); } \ + { g_mutex_lock (&memory_mutex); } \ static void egg_memory_unlock (void) \ - { g_static_mutex_unlock (&memory_mutex); } \ + { g_mutex_unlock (&memory_mutex); } \ EGG_SECURE_DEFINE_GLOBALS (egg_memory_lock, egg_memory_unlock, g_realloc); extern egg_secure_glob EGG_SECURE_GLOBALS; -- cgit v1.2.1