There is no need to unlock to change dfu state, this patch removes
lock/unlock between dfu state change. Also, some missing state change
is applied either.
Change-Id: I15215504bc4c2d7ca407285822d2508fe09b5a25
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
while (TAILQ_EMPTY(&ctx->dfu_ioq_head)) {
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+ state = DFU_THREAD_STATE_IDLE;
pthread_cond_wait(&ctx->dfu_data_arrive, &ctx->dfu_mutex);
}
if (state == DFU_THREAD_STATE_IDLE) {
- pthread_mutex_unlock(&ctx->dfu_mutex);
state = DFU_THREAD_STATE_FLASHING;
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
- pthread_mutex_lock(&ctx->dfu_mutex);
}
frame = TAILQ_FIRST(&ctx->dfu_ioq_head);