Implements RM_UnblockClient() and moduleUnblockClient(). */
| 5579 | |
| 5580 | /* Implements RM_UnblockClient() and moduleUnblockClient(). */ |
| 5581 | int moduleUnblockClientByHandle(RedisModuleBlockedClient *bc, void *privdata) { |
| 5582 | pthread_mutex_lock(&moduleUnblockedClientsMutex); |
| 5583 | if (!bc->blocked_on_keys) bc->privdata = privdata; |
| 5584 | bc->unblocked = 1; |
| 5585 | listAddNodeTail(moduleUnblockedClients,bc); |
| 5586 | if (write(g_pserver->module_blocked_pipe[1],"A",1) != 1) { |
| 5587 | /* Ignore the error, this is best-effort. */ |
| 5588 | } |
| 5589 | pthread_mutex_unlock(&moduleUnblockedClientsMutex); |
| 5590 | return REDISMODULE_OK; |
| 5591 | } |
| 5592 | |
| 5593 | /* This API is used by the Redis core to unblock a client that was blocked |
| 5594 | * by a module. */ |
no test coverage detected