diff options
Diffstat (limited to 'apps/hosted/keyboard.c')
-rw-r--r-- | apps/hosted/keyboard.c | 8 |
1 files changed, 4 insertions, 4 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 | { |