summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/termios.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/termios.c')
-rw-r--r--cpukit/libcsupport/src/termios.c10
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;
}