[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key().
From: |
Cyril Roelandt |
Subject: |
[PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key(). |
Date: |
Mon, 17 Dec 2012 00:51:25 +0100 |
* console-client/kbd-repeat.c (kbd_repeat_key): remove a redundant call to
pthread_mutex_unlock.
Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
console-client/kbd-repeat.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/console-client/kbd-repeat.c b/console-client/kbd-repeat.c
index ddfd1cf..e45902d 100644
--- a/console-client/kbd-repeat.c
+++ b/console-client/kbd-repeat.c
@@ -69,12 +69,9 @@ kbd_repeat_key (kd_event *key)
pthread_mutex_lock (&global_lock);
while (kbdbuf.size + sizeof (kd_event) > KBDBUFSZ)
{
- /* The input buffer is full, wait until there is some space. */
- if (pthread_hurd_cond_wait_np (&kbdbuf.writecond, &global_lock))
- {
- pthread_mutex_unlock (&global_lock);
- /* Interrupt, silently continue. */
- }
+ /* The input buffer is full, wait until there is some space. If this call
+ * is interrupted, silently continue. */
+ (void) pthread_hurd_cond_wait_np (&kbdbuf.writecond, &global_lock);
}
ev = (kd_event *) &kbdbuf.keybuffer[KBDBUF_POS (kbdbuf.pos
+ kbdbuf.size)];
--
1.7.10.4