summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2020-08-30 23:27:34 -0700
committerdormando <dormando@rydia.net>2020-10-30 15:50:12 -0700
commit1ca5cdce9d403b4130e35dc1c99c6a1ea15f946f (patch)
treed3db2b10a187dcb2b7f6b43086095d05e00c26fc /thread.c
parent0d4cd8af759ff29562cf17a91ed7f909f88f6e32 (diff)
downloadmemcached-1ca5cdce9d403b4130e35dc1c99c6a1ea15f946f.tar.gz
core: restructure IO queue callbacks
mc_resp is the proper owner of a pending IO once it's been initialized; release it during resp_finish(). Also adds a completion callback which runs on the submitted stack after returning to the worker thread but before the response is transmitted. allows re-queueing for pending IO if processing a response generates another pending IO. also allows a further refactor to run more extstore code on the worker thread instead of the IO threads. uses proper conn_io_queue state to describe connections waiting for pending IO's.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index d3a5403..7de7d4e 100644
--- a/thread.c
+++ b/thread.c
@@ -538,10 +538,11 @@ static void thread_libevent_process(evutil_socket_t fd, short which, void *arg)
c->thread = me;
#ifdef EXTSTORE
if (c->thread->storage) {
- conn_io_queue_add(c, IO_QUEUE_EXTSTORE, c->thread->storage, storage_submit_cb, storage_free_cb);
+ conn_io_queue_add(c, IO_QUEUE_EXTSTORE, c->thread->storage,
+ storage_submit_cb, storage_complete_cb, storage_finalize_cb);
}
#endif
- conn_io_queue_add(c, IO_QUEUE_NONE, NULL, NULL, NULL);
+ conn_io_queue_add(c, IO_QUEUE_NONE, NULL, NULL, NULL, NULL);
#ifdef TLS
if (settings.ssl_enabled && c->ssl != NULL) {