From 58cde54dcb198598edbb2559a361584d7a5b02e7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Jun 2013 14:18:57 +0200 Subject: termios: Move wake up writer task action --- cpukit/libcsupport/src/termios.c | 10 ++++++++-- 1 file 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; } -- cgit v1.2.3