Browse Source

Minor unlock cleanup

master
Con Kolivas 11 years ago
parent
commit
4b7af07036
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -710,12 +710,12 @@ static json_t *parse_subscribe(int client_id, json_t *params_val)
ck_rlock(&instance_lock); ck_rlock(&instance_lock);
client = __instance_by_id(client_id); client = __instance_by_id(client_id);
if (unlikely(!client)) {
ck_runlock(&instance_lock); ck_runlock(&instance_lock);
if (unlikely(!client)) {
LOGERR("Failed to find client id %d in hashtable!", client_id); LOGERR("Failed to find client id %d in hashtable!", client_id);
return NULL; return NULL;
} }
ck_runlock(&instance_lock);
arr_size = json_array_size(params_val); arr_size = json_array_size(params_val);
if (arr_size > 0) { if (arr_size > 0) {
@ -1207,12 +1207,12 @@ static json_t *gen_json_result(int client_id, json_t *json_msg, json_t *method_v
ck_rlock(&instance_lock); ck_rlock(&instance_lock);
client = __instance_by_id(client_id); client = __instance_by_id(client_id);
if (unlikely(!client)) {
ck_runlock(&instance_lock); ck_runlock(&instance_lock);
if (unlikely(!client)) {
LOGINFO("Failed to find client id %d in hashtable!", client_id); LOGINFO("Failed to find client id %d in hashtable!", client_id);
goto out; goto out;
} }
ck_runlock(&instance_lock);
if (!strncasecmp(method, "mining.auth", 11)) { if (!strncasecmp(method, "mining.auth", 11)) {
ret = parse_authorize(client, params_val, err_val); ret = parse_authorize(client, params_val, err_val);

Loading…
Cancel
Save