summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Suttles <jared.suttles@motorola.com>2009-11-06 06:31:37 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-06 06:31:37 -0800
commit1ae7831b8a90a9c0c614790027ce88d5fe75cf93 (patch)
tree4b87ba88aa1cdc54dcdc1e075c1ca83c70d564c7
parent0cb3f58741efa2b2b7477cbae973a29e614c62e8 (diff)
parent8b1243e5e4930598e8e78ebd18e7b6cd6fb0445f (diff)
downloadframeworks_base-1ae7831b8a90a9c0c614790027ce88d5fe75cf93.zip
frameworks_base-1ae7831b8a90a9c0c614790027ce88d5fe75cf93.tar.gz
frameworks_base-1ae7831b8a90a9c0c614790027ce88d5fe75cf93.tar.bz2
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
-rwxr-xr-xcore/jni/android_location_GpsLocationProvider.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/jni/android_location_GpsLocationProvider.cpp b/core/jni/android_location_GpsLocationProvider.cpp
index 4aed277..f845878 100755
--- a/core/jni/android_location_GpsLocationProvider.cpp
+++ b/core/jni/android_location_GpsLocationProvider.cpp
@@ -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;