Fixed simpleclient crash caused by curResource being altered
The foundResource function is called asynchronously, and was written
in a way that was not thread safe. This fix adds a lock and exit logic
so that it works prooperly and only uses the first found curResource
that matches its requirements.
NOTE: This change (author: Erich Keane) is from 01.org.
Change-Id: I984ce1623ff491713ecf5d621f1283ebad33bfef
Signed-Off-by:Sudarshan Prasad<sudarshan.prasad@intel.com>
Signed-Off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/236
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>