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