am 8b1243e5: jni: GpsLocationProvider: Check for pending callbacks before waiting

Merge commit '8b1243e5e4930598e8e78ebd18e7b6cd6fb0445f' into eclair-mr2

* commit '8b1243e5e4930598e8e78ebd18e7b6cd6fb0445f':
  jni: GpsLocationProvider: Check for pending callbacks before waiting
This commit is contained in:
Jared Suttles
2009-11-06 06:31:37 -08:00
committed by Android Git Automerger

View File

@@ -266,7 +266,9 @@ static void android_location_GpsLocationProvider_delete_aiding_data(JNIEnv* env,
static void android_location_GpsLocationProvider_wait_for_event(JNIEnv* env, jobject obj)
{
pthread_mutex_lock(&sEventMutex);
pthread_cond_wait(&sEventCond, &sEventMutex);
while (sPendingCallbacks == 0) {
pthread_cond_wait(&sEventCond, &sEventMutex);
}
// copy and clear the callback flags
int pendingCallbacks = sPendingCallbacks;