| 122 | } |
| 123 | |
| 124 | void CommandCtx_ThreadSafeContextLock |
| 125 | ( |
| 126 | const CommandCtx *command_ctx |
| 127 | ) { |
| 128 | // acquire lock only when working with a blocked client |
| 129 | // otherwise we're running on Redis main thread |
| 130 | // no need to acquire lock |
| 131 | ASSERT(command_ctx != NULL && command_ctx->ctx != NULL); |
| 132 | if(command_ctx->bc) { |
| 133 | RedisModule_ThreadSafeContextLock(command_ctx->ctx); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void CommandCtx_ThreadSafeContextUnlock |
| 138 | ( |