Fixed a pair of deadlocks on shutdown
authorErich Keane <erich.keane@intel.com>
Thu, 30 Apr 2015 16:32:12 +0000 (09:32 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 1 May 2015 17:40:38 +0000 (17:40 +0000)
commit2e6e9d42e9fcb39b39b50b1b20bdb3efae0e226d
treeb990c23facf54c3f69c45c00a51c3a6de5bc4b28
parent6f0bb6ef403d05cf8eeb6f81dbe7bfaec6751798
Fixed a pair of deadlocks on shutdown

In the event where a condition variable was signaled before it
was waited on, the thread would fail to exit properly and be
deadlocked.

This fix correctly checks the stop value before locking, and ensures
that signalling is done in a locked context as well.

Change-Id: Iab19adcee854a1ca1531deea29fa3bb6c82d042f
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/874
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/connectivity/src/caqueueingthread.c
resource/csdk/connectivity/src/caretransmission.c