The fix for the deadlocks resulted in hitting an 'else' case
inadvertantly. This ensures that no additional waiting happens
on stop.
Change-Id: Ia10a5477e4502b4dff669cdc58d7d7e978e5dc51
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/883
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
OIC_LOG(DEBUG, TAG, "wake up..");
}
- else
+ else if (!context->isStop)
{
// check each RETRANSMISSION_CHECK_PERIOD_SEC time.
OIC_LOG_V(DEBUG, TAG, "wait..(%d)microseconds",
uint64_t absTime = RETRANSMISSION_CHECK_PERIOD_SEC * (uint64_t) USECS_PER_SEC;
ca_cond_wait_for(context->threadCond, context->threadMutex, absTime );
}
+ else
+ {
+ // we are stopping, so we want to unlock and finish stopping
+ }
// mutex unlock
ca_mutex_unlock(context->threadMutex);