nn: fix race condition in execution tests

The setup of the execution tests is designed to synchronize a call to
getOutputOperandDimensions whilst an execution is running. The atomics
that were controlling this were letting that call happen before the
execution had started, and in rare (high CPU load) occasions this
would deadlock.

This CL fixes the checks on those atomics to ensure the synchronization
happens as expected. A change to configureExecutionBurst was also
required in order to get the SampleDriver to call the wrapped model
(and hence the dummyExecution), otherwise the locking semaphore wouldn't
clear and the test would freeze.

BUG=b:163081732
TEST=FEATURES=test emerge-octopus aosp-frameworks-ml-nn

Change-Id: Id78d2b25f84607f9e5fe8eb50efe11e2f94edb5f
(cherry picked from commit 8230780e6e5337692d3d5447a6f594b4908b8e03)
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/frameworks/ml/+/2690807
Reviewed-by: Michael Pishchagin <mblsha@google.com>
Tested-by: Jim Pollock <jmpollock@chromium.org>
Auto-Submit: Jim Pollock <jmpollock@chromium.org>
Commit-Queue: Michael Pishchagin <mblsha@google.com>
2 files changed