Implements RM_UnblockClient() and moduleUnblockClient(). */
| 5470 | |
| 5471 | /* Implements RM_UnblockClient() and moduleUnblockClient(). */ |
| 5472 | int 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. */ |
no test coverage detected