[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_ke
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key(). |
Date: |
Mon, 17 Dec 2012 01:20:40 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Cyril Roelandt, le Mon 17 Dec 2012 00:51:25 +0100, a écrit :
> 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
I was afraid hurd_cond_wait_np might have a different semantic that
cond_wait, but it doesn't seem so, and not only unlocking is spurious,
but nothing should be done here indeed.
Thanks,
Samuel
- [PATCH 0/7][Needs testing] Fix double mutex unlocks., Cyril Roelandt, 2012/12/16
- [PATCH 1/7] Fix double call to pthread_mutex_unlock in console_move_mouse()., Cyril Roelandt, 2012/12/16
- [PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key()., Cyril Roelandt, 2012/12/16
- Re: [PATCH 2/7] Fix double call to pthread_mutex_unlock in kbd_repeat_key().,
Samuel Thibault <=
- [PATCH 3/7] Fix double call to pthread_mutex_unlock in repeat_event()., Cyril Roelandt, 2012/12/16
- [PATCH 4/7] Fix double call to pthread_mutex_unlock in S_socket_connect., Cyril Roelandt, 2012/12/16
- [PATCH 5/7] Fix double call to pthread_mutex_unlock in _treefs_s_dir_lookup., Cyril Roelandt, 2012/12/16