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

Function moduleUnblockClientByHandle

app/redis-6.2.6/src/module.c:5472–5482  ·  view source on GitHub ↗

Implements RM_UnblockClient() and moduleUnblockClient(). */

Source from the content-addressed store, hash-verified

5470
5471/* Implements RM_UnblockClient() and moduleUnblockClient(). */
5472int moduleUnblockClientByHandle(RedisModuleBlockedClient *bc, void *privdata) {
5473 pthread_mutex_lock(&moduleUnblockedClientsMutex);
5474 if (!bc->blocked_on_keys) bc->privdata = privdata;
5475 bc->unblocked = 1;
5476 listAddNodeTail(moduleUnblockedClients,bc);
5477 if (write(server.module_blocked_pipe[1],"A",1) != 1) {
5478 /* Ignore the error, this is best-effort. */
5479 }
5480 pthread_mutex_unlock(&moduleUnblockedClientsMutex);
5481 return REDISMODULE_OK;
5482}
5483
5484/* This API is used by the Redis core to unblock a client that was blocked
5485 * by a module. */

Callers 2

moduleUnblockClientFunction · 0.85
RM_UnblockClientFunction · 0.85

Calls 4

pthread_mutex_lockFunction · 0.85
listAddNodeTailFunction · 0.85
pthread_mutex_unlockFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected