aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-11 00:16:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-11 00:16:27 +0100
commitdef7ea2c8ba62a067b63f3be65bfd44147da315f (patch)
tree5245f48a459c3e76fce1cddce5ae64dfcc7d6a72 /src/util.h
parentf06d122b502e7df46aa6860915ec8854348b5b77 (diff)
downloadrspamd-def7ea2c8ba62a067b63f3be65bfd44147da315f.tar.gz
rspamd-def7ea2c8ba62a067b63f3be65bfd44147da315f.zip
Update fuzzy storage in a separate thread.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 39473a85e..228fb7445 100644
--- a/src/util.h
+++ b/src/util.h
@@ -315,6 +315,16 @@ void rspamd_rwlock_reader_unlock (rspamd_rwlock_t *mtx);
*/
void rspamd_rwlock_free (rspamd_rwlock_t *mtx);
+static inline void
+rspamd_cond_wait (GCond *cond, rspamd_mutex_t *mtx)
+{
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION > 30))
+ g_cond_wait (cond, &mtx->mtx);
+#else
+ g_cond_wait (cond, g_static_mutex_get_mutex (&mtx->mtx));
+#endif
+}
+
/**
* Create new named thread
* @param name name pattern