Changeset 32ba5a6 in mainline for uspace/drv/char/i8042/buffer.h


Ignore:
Timestamp:
2011-12-26T22:08:24Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e67e1be
Parents:
4005e37a
Message:

i8042: Fix endless loop in buffer_read.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/i8042/buffer.h

    r4005e37a r32ba5a6  
    6464{
    6565        fibril_mutex_lock(&buffer->guard);
     66
    6667        /* Next position. */
    6768        uint8_t *new_head = buffer->write_head + 1;
    6869        if (new_head == buffer->buffer_end)
    6970                new_head = buffer->buffer;
     71
    7072        /* Buffer full. */
    7173        while (new_head == buffer->read_head)
    7274                fibril_condvar_wait(&buffer->change, &buffer->guard);
     75
    7376        /* Write data. */
    7477        *buffer->write_head = data;
     
    102105        if (new_write_head == buffer->buffer_end)
    103106                new_write_head = buffer->buffer;
    104         while (new_write_head == buffer->read_head)
     107        if (new_write_head == buffer->read_head)
    105108                fibril_condvar_broadcast(&buffer->change);
     109
    106110        /* Move head */
    107111        buffer->read_head = new_head;
Note: See TracChangeset for help on using the changeset viewer.