avoyding dedwock

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@717 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2009-04-14 19:37:42 +00:00
parent cafe6e82ad
commit 25726f7a9b
1 changed files with 6 additions and 9 deletions

View File

@ -963,8 +963,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
if (!(check = span->channels[i])) { if (!(check = span->channels[i])) {
status = ZAP_FAIL; status = ZAP_FAIL;
zap_mutex_unlock(span->mutex); break;
goto done;
} }
if (zap_test_flag(check, ZAP_CHANNEL_READY) && if (zap_test_flag(check, ZAP_CHANNEL_READY) &&
@ -975,8 +974,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
if (span && span->channel_request) { if (span && span->channel_request) {
status = span->channel_request(span, i, direction, caller_data, zchan); status = span->channel_request(span, i, direction, caller_data, zchan);
zap_mutex_unlock(span->mutex); break;
goto done;
} }
status = check->zio->open(check); status = check->zio->open(check);
@ -985,8 +983,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
zap_set_flag(check, ZAP_CHANNEL_INUSE); zap_set_flag(check, ZAP_CHANNEL_INUSE);
zap_channel_open_chan(check); zap_channel_open_chan(check);
*zchan = check; *zchan = check;
zap_mutex_unlock(span->mutex); break;
goto done;
} }
} }
@ -997,7 +994,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t
} }
} }
done: zap_mutex_unlock(span->mutex);
return status; return status;
} }