bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/7] Fix double call to pthread_mutex_unlock in repeat_event().


From: Cyril Roelandt
Subject: [PATCH 3/7] Fix double call to pthread_mutex_unlock in repeat_event().
Date: Mon, 17 Dec 2012 00:51:26 +0100

* console-client/pc-mouse.c (repeat_event): remove a redundant call to
pthread_mutex_unlock.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 console-client/pc-mouse.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/console-client/pc-mouse.c b/console-client/pc-mouse.c
index 1b7bb5d..2cec204 100644
--- a/console-client/pc-mouse.c
+++ b/console-client/pc-mouse.c
@@ -93,12 +93,9 @@ repeat_event (kd_event *evt)
   pthread_mutex_lock (&global_lock);
   while (mousebuf.size + sizeof (kd_event) > MOUSEBUFSZ)
     {
-      /* The input buffer is full, wait until there is some space.  */
-      if (pthread_hurd_cond_wait_np (&mousebuf.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 (&mousebuf.writecond, &global_lock);
     }
   ev = (kd_event *) &mousebuf.evtbuffer[MOUSEBUF_POS (mousebuf.pos 
                                                      + mousebuf.size)];
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]