summaryrefslogtreecommitdiff
path: root/src/dev/terminal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev/terminal.cc')
-rw-r--r--src/dev/terminal.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc
index a11d45554..e70a8775f 100644
--- a/src/dev/terminal.cc
+++ b/src/dev/terminal.cc
@@ -84,6 +84,11 @@ Terminal::DataEvent::DataEvent(Terminal *t, int fd, int e)
void
Terminal::DataEvent::process(int revent)
{
+ // As a consequence of being called from the PollQueue, we might
+ // have been called from a different thread. Migrate to "our"
+ // thread.
+ EventQueue::ScopedMigration migrate(term->eventQueue());
+
if (revent & POLLIN)
term->data();
else if (revent & POLLNVAL)