diff options
-rw-r--r-- | apps/hosted/keyboard.c | 8 | ||||
-rw-r--r-- | apps/hosted/yesno.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/hosted/keyboard.c b/apps/hosted/keyboard.c index 4497b60bb4..9407d970fd 100644 --- a/apps/hosted/keyboard.c +++ b/apps/hosted/keyboard.c | |||
@@ -31,7 +31,7 @@ extern JNIEnv *env_ptr; | |||
31 | static jclass RockboxKeyboardInput_class; | 31 | static jclass RockboxKeyboardInput_class; |
32 | static jobject RockboxKeyboardInput_instance; | 32 | static jobject RockboxKeyboardInput_instance; |
33 | static jmethodID kbd_inputfunc; | 33 | static jmethodID kbd_inputfunc; |
34 | static struct wakeup kbd_wakeup; | 34 | static struct semaphore kbd_wakeup; |
35 | static bool accepted; | 35 | static bool accepted; |
36 | static jstring new_string; | 36 | static jstring new_string; |
37 | 37 | ||
@@ -48,7 +48,7 @@ Java_org_rockbox_RockboxKeyboardInput_put_1result(JNIEnv *env, jobject this, | |||
48 | new_string = _new_string; | 48 | new_string = _new_string; |
49 | (*env)->NewGlobalRef(env, new_string); /* prevet GC'ing */ | 49 | (*env)->NewGlobalRef(env, new_string); /* prevet GC'ing */ |
50 | } | 50 | } |
51 | wakeup_signal(&kbd_wakeup); | 51 | semaphore_release(&kbd_wakeup); |
52 | } | 52 | } |
53 | 53 | ||
54 | static void kdb_init(void) | 54 | static void kdb_init(void) |
@@ -57,7 +57,7 @@ static void kdb_init(void) | |||
57 | static jmethodID kbd_is_usable; | 57 | static jmethodID kbd_is_usable; |
58 | if (RockboxKeyboardInput_class == NULL) | 58 | if (RockboxKeyboardInput_class == NULL) |
59 | { | 59 | { |
60 | wakeup_init(&kbd_wakeup); | 60 | semaphore_init(&kbd_wakeup, 1, 0); |
61 | /* get the class and its constructor */ | 61 | /* get the class and its constructor */ |
62 | RockboxKeyboardInput_class = e->FindClass(env_ptr, | 62 | RockboxKeyboardInput_class = e->FindClass(env_ptr, |
63 | "org/rockbox/RockboxKeyboardInput"); | 63 | "org/rockbox/RockboxKeyboardInput"); |
@@ -94,7 +94,7 @@ int kbd_input(char* text, int buflen) | |||
94 | e->CallVoidMethod(env_ptr, RockboxKeyboardInput_instance,kbd_inputfunc, | 94 | e->CallVoidMethod(env_ptr, RockboxKeyboardInput_instance,kbd_inputfunc, |
95 | str, ok_text, cancel_text); | 95 | str, ok_text, cancel_text); |
96 | 96 | ||
97 | wakeup_wait(&kbd_wakeup, TIMEOUT_BLOCK); | 97 | semaphore_wait(&kbd_wakeup, TIMEOUT_BLOCK); |
98 | 98 | ||
99 | if (accepted) | 99 | if (accepted) |
100 | { | 100 | { |
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); |