Too much CPU time used when waiting for data to be received.
This commit is contained in:
parent
4519ae7c10
commit
887930fac8
@ -33,9 +33,11 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
/*
|
||||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#endif // _POSIX_PRIORITY_SCHEDULING
|
#endif // _POSIX_PRIORITY_SCHEDULING
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace vmime {
|
namespace vmime {
|
||||||
@ -205,11 +207,19 @@ vmime::utility::childProcessFactory* posixHandler::getChildProcessFactory() cons
|
|||||||
|
|
||||||
void posixHandler::wait() const
|
void posixHandler::wait() const
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
#ifdef _POSIX_PRIORITY_SCHEDULING
|
||||||
::sched_yield();
|
::sched_yield();
|
||||||
#else
|
#else
|
||||||
::sleep(1);
|
::sleep(1);
|
||||||
#endif // _POSIX_PRIORITY_SCHEDULING
|
#endif // _POSIX_PRIORITY_SCHEDULING
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct timespec ts;
|
||||||
|
ts.tv_sec = 0;
|
||||||
|
ts.tv_nsec = 150000000; // 150 ms
|
||||||
|
|
||||||
|
nanosleep(&ts, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user