diff options
Diffstat (limited to 'apps/hosted/yesno.c')
-rw-r--r-- | apps/hosted/yesno.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/hosted/yesno.c b/apps/hosted/yesno.c index d00cb063af..a1de64e3f9 100644 --- a/apps/hosted/yesno.c +++ b/apps/hosted/yesno.c | |||
@@ -33,7 +33,7 @@ extern JNIEnv *env_ptr; | |||
33 | static jclass RockboxYesno_class = NULL; | 33 | static jclass RockboxYesno_class = NULL; |
34 | static jobject RockboxYesno_instance = NULL; | 34 | static jobject RockboxYesno_instance = NULL; |
35 | static jmethodID yesno_func; | 35 | static jmethodID yesno_func; |
36 | static struct wakeup yesno_wakeup; | 36 | static struct semaphore yesno_done; |
37 | static bool ret; | 37 | static bool ret; |
38 | 38 | ||
39 | JNIEXPORT void JNICALL | 39 | JNIEXPORT void JNICALL |
@@ -42,7 +42,7 @@ Java_org_rockbox_RockboxYesno_put_1result(JNIEnv *env, jobject this, jboolean re | |||
42 | (void)env; | 42 | (void)env; |
43 | (void)this; | 43 | (void)this; |
44 | ret = (bool)result; | 44 | ret = (bool)result; |
45 | wakeup_signal(&yesno_wakeup); | 45 | semaphore_release(&yesno_done); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void yesno_init(void) | 48 | static void yesno_init(void) |
@@ -51,7 +51,7 @@ static void yesno_init(void) | |||
51 | static jmethodID yesno_is_usable; | 51 | static jmethodID yesno_is_usable; |
52 | if (RockboxYesno_class == NULL) | 52 | if (RockboxYesno_class == NULL) |
53 | { | 53 | { |
54 | wakeup_init(&yesno_wakeup); | 54 | semaphore_init(&yesno_done, 1, 0); |
55 | /* get the class and its constructor */ | 55 | /* get the class and its constructor */ |
56 | RockboxYesno_class = e->FindClass(env_ptr, | 56 | RockboxYesno_class = e->FindClass(env_ptr, |
57 | "org/rockbox/RockboxYesno"); | 57 | "org/rockbox/RockboxYesno"); |
@@ -109,7 +109,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, | |||
109 | e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func, | 109 | e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func, |
110 | message, yes, no); | 110 | message, yes, no); |
111 | 111 | ||
112 | wakeup_wait(&yesno_wakeup, TIMEOUT_BLOCK); | 112 | semaphore_wait(&yesno_done, TIMEOUT_BLOCK); |
113 | 113 | ||
114 | e->DeleteLocalRef(env_ptr, message); | 114 | e->DeleteLocalRef(env_ptr, message); |
115 | e->DeleteLocalRef(env_ptr, yes); | 115 | e->DeleteLocalRef(env_ptr, yes); |