http_info_t *http_info = DA_NULL;
http_state_t http_state = 0;
int status;
+ int mutex_ret = 0;
DA_LOGV("");
case HTTP_STATE_REQUEST_RESUME:
case HTTP_STATE_RESUMED:
ret = PI_http_cancel(http_info);
- DA_MUTEX_LOCK(&(http_info->mutex_state));
- http_info->state = HTTP_STATE_REQUEST_CANCEL;
- DA_MUTEX_UNLOCK(&(http_info->mutex_state));
+ mutex_ret = pthread_mutex_lock(&(http_info->mutex_state));
+ if (mutex_ret == 0) {
+ http_info->state = HTTP_STATE_REQUEST_CANCEL;
+ mutex_ret = pthread_mutex_unlock(&(http_info->mutex_state));
+ if (mutex_ret != 0)
+ DA_LOGE("pthread_mutex_unlock FAIL with [%d]", mutex_ret);
+ } else {
+ DA_LOGE("pthread_mutex_lock FAIL with [%d]", mutex_ret);
+ }
break;
case HTTP_STATE_DOWNLOAD_FINISH:
ret = DA_ERR_INVALID_STATE;