aboutsummaryrefslogtreecommitdiffstats
path: root/src/platforms/posix/posixHandler.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-10-02 18:17:56 +0000
committerVincent Richard <[email protected]>2005-10-02 18:17:56 +0000
commit887930fac8ef05eb34640d890575f472bfc3cf5f (patch)
treeede52ec326e7a489d408b53153304be09af1fe46 /src/platforms/posix/posixHandler.cpp
parentFixed bug when response text is empty. (diff)
downloadvmime-887930fac8ef05eb34640d890575f472bfc3cf5f.tar.gz
vmime-887930fac8ef05eb34640d890575f472bfc3cf5f.zip
Too much CPU time used when waiting for data to be received.
Diffstat (limited to 'src/platforms/posix/posixHandler.cpp')
-rw-r--r--src/platforms/posix/posixHandler.cpp10
1 files changed, 10 insertions, 0 deletions
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 <string.h>
+/*
#ifdef _POSIX_PRIORITY_SCHEDULING
#include <sched.h>
#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);
}