Changeset c980eaf in rtems


Ignore:
Timestamp:
Oct 16, 2018, 12:35:12 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
68799dac
Parents:
143c8d0
git-author:
Sebastian Huber <sebastian.huber@…> (10/16/18 12:35:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/18/18 05:23:29)
Message:

console: Be fair in simple console read

Wait for one tick in case no character is available after a call to
getchark(). Otherwise the system is constantly busy within an input
loop (for example in the RTEMS shell). The polled Termios driver uses
the same approach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/consolesimpleread.c

    r143c8d0 rc980eaf  
    3434    int c;
    3535
    36     do {
     36    while ( true ) {
    3737      c = getchark();
    38     } while (c == -1);
     38      if ( c != -1 ) {
     39        break;
     40      }
     41
     42      (void) rtems_task_wake_after( 1 );
     43    }
    3944
    4045    buf[ i ] = (char) c;
Note: See TracChangeset for help on using the changeset viewer.