Browse Source

Merge branch 'redis_racecondition' of https://github.com/1and1/rtpengine

Change-Id: Ic6bfc64003c7ec1eac18e65396a63142c6253afa
pull/508/head
Richard Fuchs 8 years ago
parent
commit
79a74f69ff
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      daemon/redis.c

+ 5
- 6
daemon/redis.c View File

@ -2157,14 +2157,13 @@ void redis_update_onekey(struct call *c, struct redis *r) {
return; return;
err: err:
mutex_unlock(&r->lock);
rwlock_unlock_r(&c->master_lock);
if (r->ctx && r->ctx->err) if (r->ctx && r->ctx->err)
rlog(LOG_ERR, "Redis error: %s", r->ctx->errstr); rlog(LOG_ERR, "Redis error: %s", r->ctx->errstr);
redisFree(r->ctx); redisFree(r->ctx);
r->ctx = NULL; r->ctx = NULL;
mutex_unlock(&r->lock);
rwlock_unlock_r(&c->master_lock);
} }
/* must be called lock-free */ /* must be called lock-free */
@ -2190,13 +2189,13 @@ void redis_delete(struct call *c, struct redis *r) {
return; return;
err: err:
rwlock_unlock_r(&c->master_lock);
mutex_unlock(&r->lock);
if (r->ctx && r->ctx->err) if (r->ctx && r->ctx->err)
rlog(LOG_ERR, "Redis error: %s", r->ctx->errstr); rlog(LOG_ERR, "Redis error: %s", r->ctx->errstr);
redisFree(r->ctx); redisFree(r->ctx);
r->ctx = NULL; r->ctx = NULL;
rwlock_unlock_r(&c->master_lock);
mutex_unlock(&r->lock);
} }


Loading…
Cancel
Save