MCPcopy Create free account
hub / github.com/F-Stack/f-stack / clientDone

Function clientDone

app/redis-6.2.6/src/redis-benchmark.c:476–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

readHandlerFunction · 0.85

Calls 6

aeStopFunction · 0.85
pthread_mutex_lockFunction · 0.85
createMissingClientsFunction · 0.85
pthread_mutex_unlockFunction · 0.85
freeClientFunction · 0.70
resetClientFunction · 0.70

Tested by

no test coverage detected