diff options
author | dormando <dormando@rydia.net> | 2020-08-29 17:12:56 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2020-10-30 15:50:12 -0700 |
commit | df49d38930a32d342e1a3ab980c1ec432d138c2c (patch) | |
tree | 496e44dc652e37c0f012f93e4730318a22dabfa6 /thread.c | |
parent | 4c0d45a95c9ba8fb8ea0630b96f4e006ef1698a1 (diff) | |
download | memcached-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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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); |