aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-06-23 13:21:50 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-06-23 13:21:50 +0100
commit8261ba69e654814671d19a2cf17644330387c7c8 (patch)
treeed7ec41a320f5c7ec65a13153c4c053843cd8a67
parentMerge pull request #2087 (diff)
downloadmonero-8261ba69e654814671d19a2cf17644330387c7c8.tar.xz
readline_buffer: fix busy wait
It'd eat up a core constantly, due to spending its time jumping back and forth between userland and kernel. We now wait for up to a millisecond in kernel, which will be transparent to the user and drop to idle most of the time.
-rw-r--r--contrib/epee/src/readline_buffer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp
index 68b739db9..a06eb4f04 100644
--- a/contrib/epee/src/readline_buffer.cpp
+++ b/contrib/epee/src/readline_buffer.cpp
@@ -122,7 +122,7 @@ static int process_input()
struct timeval t;
t.tv_sec = 0;
- t.tv_usec = 0;
+ t.tv_usec = 1000;
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);