Fixed simpleclient crash caused by curResource being altered
authorSudarshan Prasad <sudarshan.prasad@intel.com>
Thu, 8 Jan 2015 17:28:09 +0000 (09:28 -0800)
committerSudarshan Prasad <sudarshan.prasad@intel.com>
Thu, 8 Jan 2015 17:32:36 +0000 (09:32 -0800)
commit83fed5a6c6b01d32de3e47c669652a1aa79ebb49
tree35409ed9834cb229e077dd8108dd13795c8d9226
parentfcb4f9a5e9dd9b8b76bc67ddfa56b19d138fc5b6
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>
resource/examples/simpleclient.cpp