diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-10 14:18:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-12 16:11:25 +0200 |
commit | 58cde54dcb198598edbb2559a361584d7a5b02e7 (patch) | |
tree | acf4eefc79ab304a5d331774017bf1f0bddf1842 /cpukit | |
parent | termios: Avoid second return path (diff) | |
download | rtems-58cde54dcb198598edbb2559a361584d7a5b02e7.tar.bz2 |
termios: Move wake up writer task action
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 20243cadbc..c5024d27cf 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -1287,6 +1287,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len) static int rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) { + bool wakeUpWriterTask = false; unsigned int newTail; int nToSend; rtems_interrupt_level level; @@ -1330,7 +1331,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) /* * this should never happen... */ - rtems_semaphore_release (tty->rawOutBuf.Semaphore); + wakeUpWriterTask = true; } nToSend = 0; @@ -1346,7 +1347,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) /* * wake up any pending writer task */ - rtems_semaphore_release (tty->rawOutBuf.Semaphore); + wakeUpWriterTask = true; } if (newTail == tty->rawOutBuf.Head) { @@ -1393,6 +1394,11 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty) } tty->rawOutBuf.Tail = newTail; /*apm*/ } + + if (wakeUpWriterTask) { + rtems_semaphore_release (tty->rawOutBuf.Semaphore); + } + return nToSend; } |