MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / clientDone

Function clientDone

src/redis-benchmark.cpp:481–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479}
480
481static void clientDone(client c) {
482 int requests_finished = 0;
483 atomicGet(config.requests_finished, requests_finished);
484 if (requests_finished >= config.requests) {
485 freeClient(c);
486 if (!config.num_threads && config.el) aeStop(config.el);
487 return;
488 }
489 if (config.keepalive) {
490 resetClient(c);
491 } else {
492 if (config.num_threads) pthread_mutex_lock(&(config.liveclients_mutex));
493 config.liveclients--;
494 createMissingClients(c);
495 config.liveclients++;
496 if (config.num_threads)
497 pthread_mutex_unlock(&(config.liveclients_mutex));
498 freeClient(c);
499 }
500}
501
502static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
503 client c = (client)privdata;

Callers 1

readHandlerFunction · 0.85

Calls 4

aeStopFunction · 0.85
createMissingClientsFunction · 0.85
freeClientFunction · 0.70
resetClientFunction · 0.70

Tested by

no test coverage detected