diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-02-13 21:51:10 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-02-13 21:51:10 +0400 |
commit | a5b48a05a94d178c342bbad69a330addb518d148 (patch) | |
tree | ee7ab452cd4a98fdb7503e78cc52a3d4f66dd27e /src/events.h | |
parent | 0d64c808b7310b6e233ec570649fbb281a3f2b13 (diff) | |
download | rspamd-a5b48a05a94d178c342bbad69a330addb518d148.tar.gz rspamd-a5b48a05a94d178c342bbad69a330addb518d148.zip |
* More things to be thread-safe:
- pool allocator is now thread-safe
- lua subsystem now holds lock to avoid lua stack corruption
- events subsystem now using conditional variables to wait for async_threads
- insert_result is thread-safe now
Diffstat (limited to 'src/events.h')
-rw-r--r-- | src/events.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/events.h b/src/events.h index 2c4ea2c91..1329d5837 100644 --- a/src/events.h +++ b/src/events.h @@ -6,6 +6,7 @@ struct rspamd_async_event; typedef void (*event_finalizer_t)(void *user_data); +typedef gboolean (*session_finalizer_t)(void *user_data); struct rspamd_async_event { GQuark subsystem; @@ -15,7 +16,7 @@ struct rspamd_async_event { }; struct rspamd_async_session { - event_finalizer_t fin; + session_finalizer_t fin; event_finalizer_t restore; event_finalizer_t cleanup; GHashTable *events; @@ -24,6 +25,7 @@ struct rspamd_async_session { gboolean wanna_die; guint threads; GMutex *mtx; + GCond *cond; }; /** @@ -36,7 +38,7 @@ struct rspamd_async_session { * @return */ struct rspamd_async_session *new_async_session (memory_pool_t *pool, - event_finalizer_t fin, event_finalizer_t restore, + session_finalizer_t fin, event_finalizer_t restore, event_finalizer_t cleanup, void *user_data); /** |