diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-26 09:38:47 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-26 09:38:47 +0100 |
commit | 1abb0939d17211cadd1be7b7249cf024f8cfebdf (patch) | |
tree | 6f069c5762c3b1227e70f067afc59e72c75b5054 /src/libserver/events.h | |
parent | 1c7f982f9d7a3d49c16307c17507ed7aa964754f (diff) | |
download | rspamd-1abb0939d17211cadd1be7b7249cf024f8cfebdf.tar.gz rspamd-1abb0939d17211cadd1be7b7249cf024f8cfebdf.zip |
Remove async threads for now.
They are anyway broken in the asynchronous world.
Diffstat (limited to 'src/libserver/events.h')
-rw-r--r-- | src/libserver/events.h | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/src/libserver/events.h b/src/libserver/events.h index e751c1054..442834f98 100644 --- a/src/libserver/events.h +++ b/src/libserver/events.h @@ -29,29 +29,11 @@ #include "mem_pool.h" struct rspamd_async_event; +struct rspamd_async_session; -typedef void (*event_finalizer_t)(void *user_data); -typedef gboolean (*session_finalizer_t)(void *user_data); - -struct rspamd_async_event { - GQuark subsystem; - event_finalizer_t fin; - void *user_data; - guint ref; -}; - -struct rspamd_async_session { - session_finalizer_t fin; - event_finalizer_t restore; - event_finalizer_t cleanup; - GHashTable *events; - void *user_data; - rspamd_mempool_t *pool; - gboolean wanna_die; - guint threads; - GMutex *mtx; - GCond *cond; -}; +typedef void (*event_finalizer_t)(gpointer ud); +typedef void (*event_watcher_t)(guint remain, gboolean terminated, gpointer ud); +typedef gboolean (*session_finalizer_t)(gpointer user_data); /** * Make new async session @@ -64,7 +46,7 @@ struct rspamd_async_session { */ struct rspamd_async_session * new_async_session (rspamd_mempool_t *pool, session_finalizer_t fin, event_finalizer_t restore, - event_finalizer_t cleanup, void *user_data); + event_finalizer_t cleanup, gpointer user_data); /** * Insert new event to the session @@ -74,7 +56,7 @@ struct rspamd_async_session * new_async_session (rspamd_mempool_t *pool, * @param forced unused */ void register_async_event (struct rspamd_async_session *session, - event_finalizer_t fin, void *user_data, GQuark subsystem); + event_finalizer_t fin, gpointer user_data, GQuark subsystem); /** * Remove normal event @@ -84,7 +66,7 @@ void register_async_event (struct rspamd_async_session *session, */ void remove_normal_event (struct rspamd_async_session *session, event_finalizer_t fin, - void *ud); + gpointer ud); /** * Must be called at the end of session, it calls fin functions for all non-forced callbacks @@ -99,16 +81,4 @@ gboolean destroy_session (struct rspamd_async_session *session); */ gboolean check_session_pending (struct rspamd_async_session *session); -/** - * Add new async thread to session - * @param session session object - */ -void register_async_thread (struct rspamd_async_session *session); - -/** - * Remove async thread from session and check whether session can be terminated - * @param session session object - */ -void remove_async_thread (struct rspamd_async_session *session); - #endif /* RSPAMD_EVENTS_H */ |