From 887930fac8ef05eb34640d890575f472bfc3cf5f Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 2 Oct 2005 18:17:56 +0000 Subject: [PATCH] Too much CPU time used when waiting for data to be received. --- src/platforms/posix/posixHandler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp index 651b3399..91236a4f 100644 --- a/src/platforms/posix/posixHandler.cpp +++ b/src/platforms/posix/posixHandler.cpp @@ -33,9 +33,11 @@ #include +/* #ifdef _POSIX_PRIORITY_SCHEDULING #include #endif // _POSIX_PRIORITY_SCHEDULING +*/ namespace vmime { @@ -205,11 +207,19 @@ vmime::utility::childProcessFactory* posixHandler::getChildProcessFactory() cons void posixHandler::wait() const { +/* #ifdef _POSIX_PRIORITY_SCHEDULING ::sched_yield(); #else ::sleep(1); #endif // _POSIX_PRIORITY_SCHEDULING +*/ + + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 150000000; // 150 ms + + nanosleep(&ts, NULL); }