summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2020-08-29 17:12:56 -0700
committerdormando <dormando@rydia.net>2020-10-30 15:50:12 -0700
commitdf49d38930a32d342e1a3ab980c1ec432d138c2c (patch)
tree496e44dc652e37c0f012f93e4730318a22dabfa6 /thread.c
parent4c0d45a95c9ba8fb8ea0630b96f4e006ef1698a1 (diff)
downloadmemcached-df49d38930a32d342e1a3ab980c1ec432d138c2c.tar.gz
core: generalize extstore's defered IO queue
want to reuse the deferred IO system for extstore for something else. Should allow evolving into a more plugin-centric system. step one of three(?) - replace in place and tests pass with extstore enabled. step two should move more extstore code into storage.c step three should build the IO queue code without ifdef gating.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 15ce7a1..93f247f 100644
--- a/thread.c
+++ b/thread.c
@@ -442,7 +442,7 @@ static void setup_thread(LIBEVENT_THREAD *me) {
}
#ifdef EXTSTORE
- me->io_cache = cache_create("io", sizeof(io_wrap), sizeof(char*), NULL, NULL);
+ me->io_cache = cache_create("io", sizeof(io_pending_t), sizeof(char*), NULL, NULL);
if (me->io_cache == NULL) {
fprintf(stderr, "Failed to create IO object cache\n");
exit(EXIT_FAILURE);
@@ -538,6 +538,15 @@ static void thread_libevent_process(evutil_socket_t fd, short which, void *arg)
}
} else {
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);
+ }
+#endif
+#ifdef EXTSTORE
+ conn_io_queue_add(c, IO_QUEUE_NONE, NULL, NULL, NULL);
+#endif
+
#ifdef TLS
if (settings.ssl_enabled && c->ssl != NULL) {
assert(c->thread && c->thread->ssl_wbuf);